*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Multithreading in Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Multithreading in Servlets" Watch "Multithreading in Servlets" New topic
Author

Multithreading in Servlets

ragi singh
Ranch Hand

Joined: Mar 10, 2010
Posts: 198

hi,


I would like to know if servlet supports multithreading as the STM(Single Thread Model ) supports multithreading ?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Exactly what is your question?? In STM one instance of a servlet serves only one request at a time. To serve multiple requests at the same time, the server creates multiple instances of the same servlet. STM is deprecated now. A normal servlet can serve multiple requests at the same time. The server creates a new thread for a request and calls the doGet or doPost method of our servlet through that thread...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The Single Thread Model is deprecated. All it does is to make a servlet treat a request one at a time, but it doesn't prevent other concurrency issues.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multithreading in Servlets