File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Multithreading in Servlets

ragi singh
Ranch Hand

Joined: Mar 10, 2010
Posts: 198


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

Joined: Aug 03, 2008
Posts: 9466

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é

Joined: Nov 24, 2005
Posts: 14688

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:
subject: Multithreading in Servlets
It's not a secret anymore!