img
. . . .
The Class Extensions.ConditionVar
This is one of our classes. It implements POSIX-style condition variables. Use only when
synchronized sections and wait/notify won't work.
condWait
public void condWait(Mutex m)
This causes the current thread to block until it is awakened by either a call to condSignal() or
by a spurious wakeup (not by interruption). It will release the mutex lock for the object as it goes
to sleep, and reacquire it before returning.
Reference:
Chapter 6.
condSignal condBroadcast
public void condSignal()
public void condBroadcast()
These cause (one/all) of the threads that are in a condWait() call to wake up and return.
Reference:
Chapter 6.
The Class Extensions.RWLock
This is one of our classes. It implements POSIX-style readers/ writer locks. RWlocks are useful
only in very limited circumstances. Time your program carefully first!
readLock writeLock
public void readLock()
public void writeLock()
This locks the RWLock in either reader or writer mode. If a read lock is held by a different thread,
this thread will be able to get another read lock directly. If a write lock is requested, the current
thread must go to sleep, waiting for it to become available.
Reference:
Chapter 7.
unlock
public void unlock()
This unlocks the RWLock (both for readers and for writers). If this is the last reader, it will wake
up one writer thread (if any are sleeping). If this is a writer, it will wake up one writer thread (if
any are sleeping); otherwise, it will wake up all the sleeping threads with reader requests.
Chapter 7.
Reference:
The Class Extensions.Barrier
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home