wood burning stoves*
The moose likes Tomcat and the fly likes Creating threads in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Creating threads in tomcat" Watch "Creating threads in tomcat" New topic

Creating threads in tomcat

RohitNik Sharma

Joined: Nov 23, 2005
Posts: 3

I am facing the same problem while creating threads in Tomcat.

I have a servlet in which i am calling a timer class which is continuosly running.I am planning to increase these times classes to fasten the process.

Can you please tell me wht overheads it takes if i do so and will it affect the performance of Tomcat.


William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12759
When creating additional Threads in any servlet container you need to think carefully about the implications of servicing many requests. Creating a new Thread for every request is probably a very bad idea.

Back up a bit and define what timing functions you need to have, then maybe you can get suggestions as to how to implement the functions.

It is sorta covered in the JavaRanch Style Guide.
subject: Creating threads in tomcat
Similar Threads
How does Apache Tomcat server handle the HTTPrequests?
Launch a class on application startup
Thread - instance variables
Testing if your locking works
Threads for asynchronous tasks