Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronization

 
Krishna Srinivasan
Ranch Hand
Posts: 1862
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we acheive synchronization for service method in the servlet class.
if we r using SingleThreadModel, performance will be low than any other method to achieve that?
advance thanx.
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of making the entire service method synchronized, enclose only the code that needs to be synchronized in a synchronized block.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic