• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multithreading in Servlets  RSS feed

 
ragi singh
Ranch Hand
Posts: 198
Oracle Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,


I would like to know if servlet supports multithreading as the STM(Single Thread Model ) supports multithreading ?
 
Ankit Garg
Sheriff
Posts: 9609
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!