This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mutually Exclusive lock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mutually Exclusive lock" Watch "Mutually Exclusive lock" New topic
Author

Mutually Exclusive lock

Wilson Mui
Ranch Hand

Joined: Apr 09, 2003
Posts: 140
What does that term mean in terms of threading?
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Every object has a lock associated with it.
If one thread invokes a synchronized method on an object, the lock of that object is first acquired, the method body is executed, and then the lock is released. Another thread invoking a synchronized method on that same object will block until the lock is released.
Only one thread at a time can acquire the lock of an object.
(In the Java Programming Language, they say the execution of two threads is mutually exclusive, not the lock.)
[ May 08, 2003: Message edited by: Marlene Miller ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mutually Exclusive lock
 
Similar Threads
Does Patni rock?
Infy vs I-flex
Arnold Schwarzenegger To Run California Governor!
Most in demand skills in the market
WA #1.....word association