wood burning stoves 2.0*
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
Author

What is Class Locking?

Naveen Kota
Greenhorn

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
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

"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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is Class Locking?