[concurrency-interest] ThreadPoolExecutors and System.exit

Sam Berlin sberlin at gmail.com
Thu Dec 31 14:00:45 EST 2009


I have also seen behavior like this, but have not been able to track it down
to any particular classes or methods.  On Windows, Task Manager shows the
process continues to run.  Any file locks that have been acquired continue
to remain acquired.  However, the JRE appears to be shut down (and any tools
that attempt to attach to live JREs do not show any JRE as being alive).
It's rare, but frequent enough to be frustratingly annoying.

Sam

On Wed, Dec 30, 2009 at 8:38 PM, Paulo Levi <i30817 at gmail.com> wrote:

> I have a TPE subclass and i'm seeing (disturbingly only on some dual core
> processors) a hang when the application is closed and there are lots of
> tasks to be processed. Specifically no-more tasks appear to be processed,
> but the (daemon) threads are still alive at the time shutdown hooks are
> called.
> (daemon, alive, not interrupted).
>
> Threadfactory used by the subclass creates daemon threads, and the class is
> configurated with a keepAliveTime > 0 in this case (to reuse the threads)
> and a LIFO queue instead of the normal one.
>
> I appear to be able to avoid it with a shutdown hook, but i would like to
> know if all ThreadPoolExecutors are vulnerable to this.
>
> (disturbingly too, after this, the debugger says the java process is
> closed, however windows task manager disagrees).
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20091231/f5bdfd79/attachment.html>


More information about the Concurrency-interest mailing list