I am implementing monitor synchronization. I was wondering how does implementing multiple condition variables works. So a condition variable has method wait() which puts it on the wait queue for a specific lock tied to this condition variable. So if I have multiple condition variables, do each wait call create its own separate wait queue? For eg, if I have:
lock = Lock()
A = Condition(lock)
B = Condition(lock)
C = Condition(lock)
def foo:
with lock:
while true:
A.wait()
def bar:
with lock:
while true:
B.wait()
def notifyA
with lock:
A.notifyAll()
So my question is that when we do A.notifyAll(), does it only wake up stuff in the A.wait queue or this there a combined queue for associated with the lock.