Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes By Default Servlet is Single-Thread Model or Multi-Thread Model ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "By Default Servlet is Single-Thread Model or Multi-Thread Model ??" Watch "By Default Servlet is Single-Thread Model or Multi-Thread Model ??" New topic
Author

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

Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
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

Joined: Aug 03, 2003
Posts: 26
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

Joined: Nov 27, 2001
Posts: 1561
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.


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi,
Lot of thanks for all of ur's clarification.
Thanks & Regards
Bikash
Gary Mann
Ranch Hand

Joined: Jun 05, 2003
Posts: 37
...and SingleThreadModel is about to be deprecated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: By Default Servlet is Single-Thread Model or Multi-Thread Model ??
 
Similar Threads
servlet concepts
servlet model
Is Servlets by default a single threaded model or multi threaded model
Is Servlet SingleThread Model or Multithread Model by default?
servlets