question on STM

hi.. please tell me what is the implication difference between single thread model and synchronizing doPost/doGet method ..

will both results the same i.e allowing only one thread to execute or any more difference..?

Regards, amit taneja

Thanks and Regards, Amit Taneja

kapil munjal

Ranch Hand

Posts: 298

posted 11 years ago

Hi Amit,

First, I would like to tell you that SingleThreadModel is not included in SCWCD 1.4 exam.

please tell me what is the implication difference between single thread model and synchronizing doPost/doGet method ..

will both results the same i.e allowing only one thread to execute or any more difference..?

There will be no difference between Single Thread model and synchronizing doPost and doGet EXCEPT that container can be configured to handle more than one request by creating multiple instances of the Servlet implementing SingleThread Model. But in case of doGet/doPost being synchronized, there will be only one instance serving all the requests one by one.