Condition Variables

Condition variables avoid busy-waiting by allowing a thread to block passively and be woken only when the relevant state changes, instead of continuously polling. A condition variable allows a thread to suspend execution and wait until som…

1 sources - 3 claims

Condition variables avoid busy-waiting by allowing a thread to block passively and be woken only when the relevant state changes, instead of continuously polling. A condition variable allows a thread to suspend execution and wait until some specific condition becomes true, as signaled by another thread. Condition variables are the correct pattern whenever one thread must wait for another to complete a prerequisite action.