Hi
After a long time i am asking a question.
I have a servlet deployed in tomcat, in that servlet i created a thread listening for some event, the thread will be created for each user. My question is will that thread cause performance issue.
You need to think about removing these threads as well. If you are creating these threads to perform some tasks parallel then I would suggest to have a look at java.util.concurrent package available Java 5 onwards.
This seems a dangerous task to create a new thread for each logged in user. Thread management could be difficult and may leave some holes (i.e start thread when login, and destroy when logout).
again, starting threads within container isn't a good practice. I would like some experts to speak out on this thing.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
karthic panneer wrote:Thanks for Reply
What do you mean by thread created for each user? Do you create a new thread for each request?
When a user login the thread will start for that user and it will be destroyed when the user logged out.