This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Class level syncronization v/s Method level Syncronization  RSS feed

Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I have never found out the difference between class level syncronization and method level organization.

Can anyone elaborate on the same with some example?

I have been asked this question many a times in the interview but never got answer for myself.

Thanks in advance,
author and iconoclast
Posts: 24203
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing called "method level synchonization" that contrasts with anything that could be called "class level sychronizations". One thing you might possibly be referring to is the difference between synchronization of class (static) methods and instance (non-static) methods. Instance methods are synchronized at the instance level -- i.e., threads compete for individual objects, but the same method can be called simultaneously on two separate objects. Static methods are synchronized on the Class object for the class, and all Threads must compete for that to call any static synchronized methods in a class.

I'm going to move this to our Threads and Synchronization forum; it surely isn't Advanced Java.
Seriously Rick? Seriously? You might as well just read this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!