Message 157944 - Python tracker (original) (raw)

The Condition variables are canonically prone to "spurious wakeups" and "stolen wakeups".

No, they aren't. Just because POSIX says they are doesn't mean our condition variables are the same. Spurious wakeups are an annoyance, and our implementation AFAICT never exhibited them.

From the docs: "Note: Condition variables can be, depending on the implementation, subject to both spurious wakeups (when wait() returns without a notify() call) and stolen wakeups (when another thread acquires the lock before the awoken thread.) For this reason, it is always necessary to verify the state the thread is waiting for when wait() returns and optionally repeat the call as often as necessary."

Ah, thanks, indeed. Except that... this was added by yourself in 483bbebc57bf, after issue 10260, but without being part of the original patch that you uploaded on that issue. So this never got reviewed and was instead sneaked in the docs in a commit of yours. Unless other people disagree, I think this addition should be reverted.