• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

synchronization of servlet

 
anish jain
Ranch Hand
Posts: 129
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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
  • 0
  • 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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic