aspose file tools
The moose likes Servlets and the fly likes Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Synchronization" Watch "Synchronization" New topic
Author

Synchronization

Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1803
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
OCAJP 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Synchronization
 
Similar Threads
Encapsulation
race condition?
Why we should prefer synchronization?
Is there any alternative for synchronization?
advantage of synchronization