previous | start | next

Alternative to pthread_cond_broadcast

If the first thread released from within pthread_cond always makes the guard false from within its statement sequence, it is pointless to wake up all the other waiting threads since they would just block again waiting on the mutex.

An alternative to pthread_cond_broadcast is

 pthread_cond_signal(&cond_var)
   

which wakes up the first thread on the condition variable wait queue.



previous | start | next