Condition Variables
This lesson explains the concept of condition variables in Python.
We'll cover the following...
Condition Variables
Synchronization mechanisms need more than just mutual exclusion; a general need is to be able to wait for another thread to do something. Condition variables provide mutual exclusion and the ability for threads to wait for a predicate to become true.
For Java programmers, the condition variable and its working may seem eerily familiar and rightly so because the threading module borrows a lot from Java's concurrency architecture. We'll examine the similarities towards the end of the lesson. First, let's try to understand why we need condition variables in the first place.
Why
In the previous sections we worked with locks which are used to enforce serial access to shared state. However, ...