This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes object lock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "object lock" Watch "object lock" New topic
Author

object lock

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Hi All,
I have one question : what is object lock ?

Thanks,
Satya
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

Hi Satya,

Your question is quite ambiguous (at least to me).

Do you mean to say lock related class (e.g. java.util.concurrent.locks.ReentrantLock)? Or do you mean lock obtained on an object (by synchronized block)?

Also, what exactly do you want to know about it?


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Hi Anayonkar,
I want to know
a) what is ReentrantLock and how actually its work ?
b) The lock obtained on an object ..

Thanks
-- Satya
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

S Majumder wrote:Hi Anayonkar,
I want to know
a) what is ReentrantLock and how actually its work ?
b) The lock obtained on an object ..

Thanks
-- Satya

Well, I would highly suggest firstly go through JavaDocs of corresponding classes. If you face any doubt(s), you can always post here.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18914
    
  40


The Oracle tutorial on threads is also a good place to start....

http://docs.oracle.com/javase/tutorial/essential/concurrency/

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: object lock