harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgueni Brevnov" <evgueni.brev...@gmail.com>
Subject Re: [dlvm][classlib] Re: hythr library problem... easy fix?
Date Tue, 05 Dec 2006 12:33:03 GMT
Here is my understanding....

By looking at classlib's spec and impl for hythread_detach shows that
it is pretty valid to detach any attached thread (not current thread
only). So classlib's implementation does ignore the request to detach
the thread as it suggested in the patch.

>From the other hand I would really like to understand why this
functionality is required. Until I see the real use case it seems quit
strange when one thread detaches another and the later one may still
be running.... Alexey, could you share the stack traces for the
failing case...


Thanks
Evgueni

On 12/5/06, Alexey Petrenko <alexey.a.petrenko@gmail.com> wrote:
> 2006/12/4, Geir Magnusson Jr. <geir@pobox.com>:
> >
> >
> > (Added categories, more inline)
> >
> > Alexey Petrenko wrote:
> > > hythr library problem in short...
> > > hythr library from classlib can not work with DRL VM. hythr library
> > > from DRL VM can not work with IBM VME (crash). Since hythr library is
> > > placed in bin directory we can not use both Harmony VMs at the same
> > > time.
> > >
> > > This problem is active and known for a long period of time. Last
> > > thread on this issue is here:
> > > http://mail-archives.apache.org/mod_mbox/harmony-dev/200611.mbox/%3cc3755b3a0611130203r2ed7fadard81e1613257e2420@mail.gmail.com%3e
> > >
> > >
> > > During the weekend I had some free time and decided to look why J9 can
> > > not work with hythr from DRL VM. The investigation shown that the
> > > problem is in additional assert in hythread_detach method (comparing
> > > to classlib implementation) and easy fix lets all the class library
> > > tests to pass with J9 and hythr from DRL VM both on Windows and Linux.
> > >
> > > Here is an easy fix:
> > > --- vm/thread/src/thread_native_basic.c (revision 481203)
> > > +++ vm/thread/src/thread_native_basic.c (working copy)
> > > @@ -274,7 +274,9 @@
> > >     // Acquire global TM lock to prevent concurrent acccess to thread list
> > >     IDATA status;
> > >
> > > -    assert(thread == tm_self_tls);
> > > +    if (thread != tm_self_tls)
> > > +        return;
> >
> > These aren't semantically the same because you are letting the caller go
> > in it's merry way as if all is well, when in fact the API contract says
> > "we're dead if this isn't true"...
> Yes, I understand this.
> But! It works! :)
> Class library tests are passed.
> And I could not find corresponding assert in hythread_detach from class library.
>
> SY, Alexey
>

Mime
View raw message