This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.