Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

synchronization of servlet

 
anish jain
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me the difference between synchronizing the service or doget or dopost methods and implementing SingleThreadModel
Which one is better?
I tried to google it but couldn't get the satisfactory answer?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They amount to the same thing - and both are awful; don't do either. Java has so many synchronization and concurrency features by now that destroying concurrency for all clients -which is what those two approaches do- is not necessary.
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There can be some fairly significant differences, like allowed servlet instance pooling, but SingleThreadModel was deprecated in Servlet 2.4...
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!