Hi,
I have 1 master thread and 4 worker threads. I want to be able to have the master thread call cond_broadcast() only when all of the worker threads are in cond_wait()...
If I increment a certain counter before calling cond_wait then I have this scenario for you.. what if the last thread increments the counter and then the master thread exits out of its loop and calls cond_broadcast while the last thread has not called cond_wait() yet.
you see, my problem is hard and I am stumped.
I would greatly appreciate any help. Thank you.