[issue8799] Hang in lib/test/test_threading.py

Antoine Pitrou report at bugs.python.org
Tue Apr 10 12:38:59 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> 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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8799>
_______________________________________


More information about the Python-bugs-list mailing list