• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how servlets handle multiple requests concurrently

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A thread can be reused naturally in keep alive implementation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic