harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rana Dasgupta" <rdasg...@gmail.com>
Subject Re: [drlvm]shutdown deadlock with gc.multithreads
Date Tue, 10 Apr 2007 00:13:10 GMT
Vladimir,
  This is on Win32. I don't think it can  happen on Linux which has
deferred thread cancellation. So it is urelated to other smoke test
failures you have seen on linux x86.

Thanks,
Rana

On 4/5/07, Vladimir Ivanov <ivavladimir@gmail.com> wrote:
> Similar (or this?) issue discussed at thread:
> [drlvm][threading] Some smoke tests started to hang this week on linux x86
>  thanks, Vladimir
>
> On 4/6/07, Rana Dasgupta <rdasgupt@gmail.com> wrote:
> > On my 32 bit dual core machine running Win32 XP SP2, this test often
> > deadlocks on exit and hangs after printing "PASSED" on the console.
> > This happens often and I can break into it with the debugger. This
> > shows that the shutdown thread is deadlocked waiting for a semaphore
> > that has not been cleanly released, possibly by one of the threads
> > terminated( cancelled ) by the shutdown process.
> >
> > Examples are the global mutex guarding hymutex_lock(&lib->TM_LOCK) in
> > countdown_nondaemon_threads() and elsewhere. Since TerminateThread is
> > an abrupt termination on Windows, this is certainly possible.
> >
> > The Windows implementation of ExitProcess() uses an approach of
> > weakening all the critical sections after killing the threads to allow
> > the shutdown to continue, though this can of course expose some
> > inconsistent state to the shutdown thread. We can't do this, but as an
> > emulation, I created jthread_detach_shutdownthread() and
> > hythread_detach_shutdownthread() which are almost lock free. They are
> > only called by the shutdown thread very late when all the other
> > threads have exited and there can be no races.  I attach this in
> >
> > https://issues.apache.org/jira/browse/HARMONY-3582
> >
> > Maybe Weldon and others working on fixing threading can consider
> > whether we want to take this approach.  If so, I can clean up the
> > patch and verify it  on Linux where we don't have the problem due to
> > cleaner thread cancellation. Adding a hythread function is also a
> > little messy and needs a little more cleanup that is worth doing only
> > if the approach makes sense.
> >
> > Thanks,
> > Rana
> >
>

Mime
View raw message