You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Vanspall <st...@crmsoftware.com.au> on 2005/04/01 07:24:10 UTC

Proper way to open threads in a servlet

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.

Tahnks in advance

Steve




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