harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weldon Washburn" <weldon...@gmail.com>
Subject Re: [drlvm][threading] Thread.suspend() causes thread_native_fat_monitor.cpp::monitor_wait_impl() to give up the monitor
Date Tue, 05 Dec 2006 05:28:28 GMT
On 12/4/06, Nikolay Kuznetsov <nikolay.kuznetsov@gmail.com> wrote:
>
> Weldon, I've found the cause that resulted in that code to appear.
> This one covers the situation when waiting thread being suspended and
> notified after that. This code is the part of the patch that prevents
> suspended thread from acquiring that lock after notification.


Thanks for the explanation.  It seems there are several things going on
here.  I think you mean to say, "prevents suspended thread from long term
*holding* that lock after notification".  Given the way the code is
structured, a suspended thread acquires then immediately releases the lock.
There is no benefit from the suspended thread thrashing the lock.

I can see that the code provides nicer behavior.  The suspended thread does
not hold the lock during suspension but instead acquires the lock once
suspension is lifted.

Is it an issue of complying with the behavior of another JVM
implementation?  Or is it a bug that needed fixing?  In either case, it
would be much appreciated if you can you point to the regression test(s)
that corresponds to the below.


Nik.
>
> On 12/4/06, Weldon Washburn <weldonwjw@gmail.com> wrote:
> > The following code does not look right.  I looked in the JVM spec.  I
> can't
> > find any mention that a Thread.suspend() should cause the target thread
> to
> > give up any java lock.  I am trying to construct a test to confirm if
> this
> > is a problem or not.  Anybody have any suggestions?
> >
> > line 216:
> >
> >
> > if(self->suspend_request) {
> >
> >     hymutex_unlock(mon_ptr->mutex);
> >
> >     hythread_safe_point();
> >
> >     hymutex_lock(mon_ptr->mutex);
> >
> > }
> >
> >
> > --
> > Weldon Washburn
> > Intel Enterprise Solutions Software Division
> >
> >
>



-- 
Weldon Washburn
Intel Enterprise Solutions Software Division

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message