aspose file tools
The moose likes Threads and Synchronization and the fly likes doubt in synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "doubt in synchronization" Watch "doubt in synchronization" New topic
Author

doubt in synchronization

manas ranjan mandal
Ranch Hand

Joined: Apr 02, 2008
Posts: 97
what is the difference between syncronize a block and synchronize an entire method?
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Originally posted by manas ranjan mandal:
what is the difference between syncronize a block and synchronize an entire method?


Difference is the object on which it is synchronized.
In a sync block you specify the object you want to synchronize upon.
A synchronize instance method synchronize on "this"
A synchronize static method synchronize on "class" static member variable present for every class.


apigee, a better way to API!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in synchronization