Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

By Default Servlet is Single-Thread Model or Multi-Thread Model ??

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all Friends,
I want to clear my doubts By Default Servlet is Single-Thread Model or Multi-Thread Model.Can any one please explain it.
Thanks & Regards
Bikash
 
Benny Tang
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Servlet is multi-threaded by dafault. If the servlet class implements the SingleThreadModel interface. Then it should be single-thread.
Benny
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default is multithreaded. If you like your servlet to behave like single thread, then you must implement the SingleThreadedModel interface.
By implementing this interface, you're telling the container that it cannot service requests concurrently, therefore decreasing performance. So the service() method will not be executed in more than one thread at a time.
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Lot of thanks for all of ur's clarification.
Thanks & Regards
Bikash
 
Gary Mann
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and SingleThreadModel is about to be deprecated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic