This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Synchronization" Watch "Synchronization" New topic
Author

Synchronization

Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1844

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.


Krishna Srinivasan
Spring Tutorials, OCAJP Mock Questions, 400+ OCPJP Mock Questions
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
Instead of making the entire service method synchronized, enclose only the code that needs to be synchronized in a synchronized block.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronization
 
Similar Threads
advantage of synchronization
race condition?
Why we should prefer synchronization?
Encapsulation
Is there any alternative for synchronization?