harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Afremov" <pavel.n.afre...@gmail.com>
Subject Re: [harmony][Thread]
Date Tue, 18 Dec 2007 15:23:41 GMT
Hi.
There are two aspects why m2n frame should be created for slow path:

   1. Slow path can throw illegal monitor state exception. So in current
   design to throw exception from native frame m2n should be created.
   2. Slow path can be VERY slow. Routine can enter into it and wait when
   monitor became free, to catch it. To allow VM process GC at this time of
   waiting, m2n frame should be created on this thread for enumeration purpose.

BR
Pavel Afremov.

On Dec 18, 2007 5:35 PM, 史成荣 <icyrong@gmail.com> wrote:

> I am not familiar with the relationship between setting the m2nframe and
> GC.
> I guess if there is no potential garbage collection, it's better to take
> the
> fast path,because the fast path does not contain safepoint for GC to
> start,
> and if GC really happens when a thread is requiring or releasing a lock,
> then it should transfer from the fast path to the slow one so that GC
> can start, because the slow path contains safepoint for GC to start. And
> in order to unwind the stack correctly, the m2nframe should be setted
> before
> the slow path.
> Am I right or I missed some thing else?
>
>  Thanks,
> Chengrong
>
>
> 2007/12/18, Xiao-Feng Li <xiaofeng.li@gmail.com>:
> >
> > On Dec 18, 2007 8:43 PM, 史成荣 <icyrong@gmail.com> wrote:
> > > why does it need setting the m2nframe before the slow path while it
> > needn't
> > > when taking the fast path?
> >
> > As I said below, that's for potential garbage collection or exception
> > throwing, when you need unwind the stack correctly.
> >
> > Thanks,
> > xiaofeng
> >
> > > 在07-12-18,Xiao-Feng Li <xiaofeng.li@gmail.com> 写道:
> > >
> > > >
> > > > Chengrong, locking is expensive, which should be optimized or
> avoided.
> > > > The fast path acquiring the lock without Java-native border crossing
> > > > can be much fast. It's expected the fast path be executed in most
> > > > cases. This is possible if the code sequence doesn't trigger garbage
> > > > collection or exception, hence no need to bookkeeping the frames.
> > > >
> > > > Thanks,
> > > > xiaofeng
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > http://xiao-feng.blogspot.com
> >
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message