OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
wait
thread)
(transparent to
System activity YES
NO
(unlock)
(lock)
proceed
and unlock
lock
Thread A
predicate
read
wait
mutex_ready
ready
mutex_ready
First, thread A locks the mutex named mutex_ready that is associated with the condition
variable. Then it reads the predicate associated with the condition variable named
ready. If the predicate indicates that thread B has finished task X, then thread A can
unlock the mutex and proceed with task Y. If the condition variable predicate indicated
that thread B has not yet finished task X, however, then thread A waits for the condition
variable to change. Thread A calls the wait primitive. Waiting on the condition variable
automatically unlocks the mutex, allowing thread B to lock the mutex when it has
finished task X (see Figure 7-4).
Figure 7-4. Thread B Signals Condition Ready
Signal
unlock
write
mutex_ready
ready=
YES
mutex_ready
X
lock
Thread B
7 10 Tandem Computers Incorporated 124245