What is the role of synchronization when we making a servlet as singlethreadmodel?

Questions by guptakcsg

Showing Answers 1 - 3 of 3 Answers

pramod.reddy

  • Mar 15th, 2007
 

Making a Servlet as SingleThreadModel means u r making sure that no two or more clients can awail the services of the servlet at the same time  and synckhronization is mechanism of making sure that a resource will not be used by one or more thread at the same time. SingleThreadModel makes sure that only one client is awailing the service of the servlet.

  Was this answer useful?  Yes

Jagdish111

  • Mar 21st, 2007
 

in singleThreadModel Web Container is going to create a number of servlet objects, each object can be accessed by only one thread at a time, if the number of clients are more then there will be two possibility either server(WC) will create more number of servlet objects--this will degrade the performance of the application or clients have to wait for the servlet object this will tend to keep wait the client and also implementing the single thred mode does not guarantee the application will be threadSafe.l

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions