Using Condition.signal is not correct in these cases, because it is possible that multiple fibers manage to start Condition.wait and a single Condition.signal does not wake up all of them. Another alternative would be to Condition.signal every time the queue is not empty or is not full.
Using
Condition.signal
is not correct in these cases, because it is possible that multiple fibers manage to startCondition.wait
and a singleCondition.signal
does not wake up all of them. Another alternative would be toCondition.signal
every time the queue is not empty or is not full.