File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes how servlets handle multiple requests concurrently Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how servlets handle multiple requests concurrently" Watch "how servlets handle multiple requests concurrently" New topic
Author

how servlets handle multiple requests concurrently

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi all,
Servlets typically run inside multithreaded servlet containers that can handle multiple requests concurrently.please explain how these multiple requests are processed by the servlet's service method at a time.

thanks in advance
saiprasanna
sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi
its by creating one thread for each request on the servlet instance(which is only one for a servlet).
thanks in advance
saiprasanna
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Not necessarily. Containers often maintain a pool of threads for performing threaded tasks. A Thread from the thread pool is usually assigned the task rather than creating a new one for each incomming request.
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
A thread can be reused naturally in keep alive implementation.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how servlets handle multiple requests concurrently