tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How to spwan child processes.
Date Mon, 23 Aug 2010 19:38:34 GMT
Hash: SHA1


On 8/23/2010 11:02 AM, Caldarale, Charles R wrote:
>> From: Wesley Acheson []
>> Subject: Re: How to spwan child processes.
>> Thats my point I thought new Thread() was something I couldn't 
>> do (by JEE specs)
> I'm curious - where in any of the Java EE specs did you come across that?

Regardless of the presence or absence of such a requirement in any
J2EE-related specification, it doesn't change the fact that creating
your own threads inside of a server application - whether it be within
an EJB or a servlet or whatever - is risky business.

If you're not careful, you can starve your own application of resources
and open your application up to a trivially-exploitable DOS hole.

Some techniques for responsibly performing asynchronous work are:

1. Use TimerTask
2. Use Executors in java.util.concurrent
3. Use Quartz (note that some versions of Quartz have a resource leak
               upon webapp shutdown)
4. Use a database/whatever as a queue and run an out-of-process
notification program (my personal favorite)

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message