This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes What is Class Locking? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "What is Class Locking?" Watch "What is Class Locking?" New topic

What is Class Locking?

Naveen Kota

Joined: Sep 26, 2005
Posts: 2
What is Class locking? How do we achieve Class Locking? What is the difference between Class Locking and Object Locking?

Naveen Kota<br />NMS Engineer
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189

"Object locking" and "class locking" aren't established, meaningful terms with specialized, subtle depths of meaning. They just refer to synchronizing on an instance of a class ("object locking") or synchronizing on the java.lang.Class instance that represents a class ("class locking,") Nothing special or mysterious at all about "class locking"; it's just what static methods (aka "class methods") do for synchronization.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: What is Class Locking?
jQuery in Action, 3rd edition