harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "weldon washburn (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4029) [drlvm][shutdown][thread] There should be a safe way to shutdown daemon threads which wouldn't cause deadlock with main thread
Date Wed, 18 Jul 2007 23:23:05 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

weldon washburn updated HARMONY-4029:

    Priority: Minor  (was: Major)

> [drlvm][shutdown][thread] There should be a safe way to shutdown daemon threads which
wouldn't cause deadlock with main thread
> ------------------------------------------------------------------------------------------------------------------------------
>                 Key: HARMONY-4029
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4029
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: weldon washburn
>            Priority: Minor
> The bug in HARMONY-3314 is a specific case of a more general bug of killing daemon threads
on shutdown.
> Specification defines daemon threads as threads that VM kills when no non-daemon threads
are left. Specification doesn't require the programmer who uses daemon treads to use Thread.join
or implement any other precautions for clean shutdown. It is VM which has to handle this.
> When a thread is shut down in DRLVM it has to unregister from its ThreadGroup while detaching
from VM. This operation is synchronized and only one thread at a time can delete itself from
ThreadGroup object. VM doesn't wait enough for all daemon threads to accomplish it since VM
has no idea whether a daemon thread is goring to detach itself from VM or it just hangs. VM
quickly kills in a hard way all daemon threads that didn't shut down themselves yet, and often
VM kills a daemon thread in its detach process while it is in synchronized block of deleting
itself from ThreadGroup object.
> Then later when all daemon threads are killed, main thread tries to detach itself from
VM as well, and if some daemon thread was killed in a hard way inside of a synchronized block,
the monitor is held by a zombie thread which doesn't exist any more. Therefore main thread
hangs forever on trying to get this monitor.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message