[issue8411] Improve condition variable emulation on NT

Antoine Pitrou report at bugs.python.org
Sun Aug 8 21:41:08 CEST 2010


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

Questions:

- why does _cond_timed_wait() decrement n_waiting *twice*?

- why does _cond_timed_wait() use InterlockedDecrement()? it doesn't protect against regular accesses to the same memory location, since it isn't guarded by the mutex

- why don't you simply pass NULL as the third parameter to ReleaseSemaphore() in _cond_signal()?

- I don't understand what you call "possible race condition" in _cond_signal(). _cond_signal() is currently always called with the corresponding mutex held, by the way. We could add a comment to make it mandatory.

----------
nosy: +jyasskin

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


More information about the Python-bugs-list mailing list