tomcat-users mailing list archives

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

All,

On 8/23/2010 11:02 AM, Caldarale, Charles R wrote:
>> From: Wesley Acheson [mailto:wesley.acheson@gmail.com]
>> 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxyzjoACgkQ9CaO5/Lv0PDghgCfbOusWE/C+FRVrhYsXOMbobIc
T/kAniflWhvYSYgkoxq2Vq8vi+UxMr5l
=r8qO
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message