GeekInterview.com
Series: Subject: Topic:
Question: 159 of 177

Difference between single thread and multi thread model servlet


Answered by Scott on 2005-05-12 10:39:32: A servlet that implements SingleThreadModel means that for every request, a single servlet instance is created. This is not a very scalable solution as most web servers handle multitudes of requests. A multi-threaded servlet means that one servlet is capable of handling many requests which is the way most servlets should be implemented. 
 
A single thread model for servlets is generally used to protect sensitive data ( bank account operations ).
Asked by: Interview Candidate | Asked on: May 12th, 2005
Showing Answers 1 - 3 of 3 Answers
Pooja Gupta

Answered On : Apr 13th, 2005

Single thread model means instance of the servlet gets created for each request recieved. Its not thread safe whereas in multi threaded only single instance of the servlet exists for what ever # of requests recieved. Its thread safe and is taken care by the servlet container.

  
Login to rate this answer.
Scott

Answered On : May 12th, 2005

A servlet that implements SingleThreadModel means that for every request, a single servlet instance is created. This is not a very scalable solution as most web servers handle multitudes of requests. A multi-threaded servlet means that one servlet is capable of handling many requests which is the way most servlets should be implemented. 
 
A single thread model for servlets is generally used to protect sensitive data ( bank account operations ).

  
Login to rate this answer.
chandra_raya

Answered On : Jul 12th, 2006

Hi,

As the name says Singlethread means only one thread, can access the service method of the servlet, to reduce the overhead the servlet container creates pool of servlet instances to handle n number of request that is depend on the servler configuration

thanks

chandra

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.