[concurrency-interest] daemon or not

Andreas Sterbenz Andreas.Sterbenz@Sun.COM
Fri, 28 Nov 2003 16:09:51 +0000


Hi,

I see that the recently added defaultThreadFactory() creates Threads as 
non-daemon threads. I wonder if creating them as daemon would be a 
better default.

My reasoning is simple: if the default is (daemon == true) but you want 
don't want the VM to exit, just create a thread to keep the VM alive 
yourself (I suspect most apps have some form of such a thread anyway).

On the other hand, if the default is (daemon == false) but you don't 
want to have your VM kept running by the thread pool, you have to 
implement your own ThreadFactory. Although simple that is obviously more 
work.

Andreas.