Timers should be daemon threads, right ?

Brent Putman putmanb at georgetown.edu
Wed Feb 25 00:15:38 EST 2015


On 2/25/15 12:07 AM, Tom Zeller wrote:
> In v2 when we instantiate Timers, we make them daemon threads via 'new
> Timer(true)'. In v3, we don't always do this. We should, correct ?


Yes, I think in a web app they should generally always be daemon
threads.  I can't think of a legitimate reason they should be otherwise.

If they're not I think they would prevent the JVM from shutting down. 
Maybe the servlet containers have some special handling to kill off
errant non-daemon threads, or something.


More information about the dev mailing list