...
This noncompliant code example violates the liveness property.
Compliant Solution (cnd_broadcast()
)
...
Awakening all threads solves guarantees the liveness property because each thread will execute its condition predicate test, and exactly one will succeed and continue execution.
...
CERT Oracle Secure Coding Standard for Java | THI04THI02-J. Notify all waiting threads rather than a single thread |
Bibliography
[IEEE Std 1003.1:2013] | XSH, System Interfaces, pthread_cond_broadcast XSH, System Interfaces, pthread_cond_signal |
[Lea 2000] |
...