tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: Proper way to open threads in a servlet
Date Fri, 01 Apr 2005 11:45:21 GMT
Ya, you can open a new thread which has the sole job of sending the email 
then dying. The only drawback is if sending the email hangs, then tomcat 
could hang unless you make the thread a daemon thread.


Steve Vanspall wrote:

> Hi there,
> I am concerned that opening a thread in my serlvet using new Thread(Runnable) style code,
is causing a massive hang in my system.
> Basically what the thread does is email people to notify them of a change in an order
on the system.
> I want the emails to be sent in a separate thread so that the user doesn't have to wait
for this to complete to return to the system.
> Basically the email is a non crucial part, the action has already been performed. I know
this isn't specifically a Tomcat question, but I thought I would ask it anyway.
> The two ways this could work is that the email is placed in a queue, that is checked
periodically, or just somehow the email(s) are sent in the background, but without opening
a new thread using code.
> Can anyone give me some pointers on how to do this. Yes I have been searching around,
but haven't found much information.

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

View raw message