This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URGENT : Thread Problems

 
j krishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How many threads can be started simaltaneously in a servlet engine .for eg I am using Tomcat3.2.1 My servlet hangs if i start more than 75 threads.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is highly dependent on your JVM; see the Volano report for some comparative figures, esp. the network scalability figure (which is largely governed by threading behaviour). A highly tuned server JVM like JRockit might help you.
Are you implying that you have one servlet which starts up 75 threads? Or are you hitting the servlet engine with 75 simultaneous requests? They are two different things. In the former case, I would wonder whether this is really necessary and/or productive. In the latter case, I would ask what exactly you are doing in your servlet.
- Peter
 
j krishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My servlet ping to the devices for a particular poling interval and calculates threshold failures etc etc , for this i am staring a timer Object for pinging and stoping it.
Originally posted by Peter den Haan:
That is highly dependent on your JVM; see the Volano report for some comparative figures, esp. the network scalability figure (which is largely governed by threading behaviour). A highly tuned server JVM like JRockit might help you.
Are you implying that you have one servlet which starts up 75 threads? Or are you hitting the servlet engine with 75 simultaneous requests? They are two different things. In the former case, I would wonder whether this is really necessary and/or productive. In the latter case, I would ask what exactly you are doing in your servlet.
- Peter

 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a job for a Timer and one or more TimerTasks, perhaps at the core of a scheduler servlet or application-scoped scheduler object. Where do the other 74 threads come in?
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic