Download Programming with Concurrent Threads Robert M. Dondero, Ph.D. Princeton University

Document related concepts

Scheduling (computing) wikipedia , lookup

Transcript
User-Level Locking in Java

See LockInUser.java
synchronized(sharedobj)
{ stmt; stmt; …}


Current thread: "Make sure I have the lock on
sharedobj"
Other threads cannot obtain lock on sharedobj
during execution of block
21