Condition Variables for Synchronization

 $&bull#bullet;$
pthread_cond_init & pthread_cond_destroy

\includegraphics[scale=1.3]{figures/7-8}
 $&bull#bullet;$
Function calls for initializing and destroying condition variables.
 $&bull#bullet;$
Condition variables must be declared with type pthread_cond_t, and must be initialized before they can be used.
 $&bull#bullet;$
There are two ways to initialize a condition variable:
1
Statically, when it is declared. For example: pthread_cond_t myconvar = PTHREAD_COND_INITIALIZER;
2
Dynamically, with the pthread_cond_init() routine.

Figure 6.8: A representative sequence for using condition variables.
\includegraphics[width=13cm]{figures/7-11}

Cem Ozdogan 2010-12-27