[concurrency-interest] ThreadPoolExecutors and System.exit

Paulo Levi i30817 at gmail.com
Wed Dec 30 20:38:00 EST 2009


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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20091231/d6b11dab/attachment.html>


More information about the Concurrency-interest mailing list