Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question on STM  RSS feed

 
amit taneja
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
kapil munjal
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

yes, both will allow only one thread to execute at a time.

I hope it helps.

Kapil
 
amit taneja
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx kapil
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!