...
Compliant Solution (Using cnd_signal()
but with a Unique Condition Variable per Thread)
Another compilant compliant solution is to use a unique condition variable for each thread (all associated with a single mutex). In this case, the signal operation (cnd_signal()
) wakes up only the thread that is waiting on it. This solution is more efficient than using cnd_broadcast()
because only the desired thread is awakened.
...