• Post Reply Bookmark Topic Watch Topic
  • New Topic

synchronized and synchronize  RSS feed

 
thomas davis
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between synchronized and synchronize ?
Where do we need to use them?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're quite similar. Marking a method as "synchronized" is more or less exactly the same as enclosing the entire body of the method in a "synchronize(this)" block.

As to "where to use them" -- and what they mean -- entire books have been written on this topic. One place you might start would be Sun's tutorial on Java threads.

I'm going to move this to our Threads and Synchronization forum for follow-up.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!