Why does Python threading.Condition() notify() require a lock?
Why does Python threading.Condition() notify() require a lock? Question: My question refers specifically to why it was designed that way, due to the unnecessary performance implication. When thread T1 has this code: cv.acquire() cv.wait() cv.release() and thread T2 has this code: cv.acquire() cv.notify() # requires that lock be held cv.release() what happens is that T1 …
Total answers: 6