[issue11618] Locks broken wrt timeouts on Windows

Kristján Valur Jónsson report at bugs.python.org
Mon Mar 21 18:16:23 CET 2011


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

Antoine:  I agree, the semaphore is the quick and robust solution.

sbt: I see your point.  Still, I think we still may have a flaw:  The statement that (owned-timeouts) is never an under-estimate isn't true on modern architectures, I think.  The order of the atomic decrement operations in the code means nothing and cannot be depended on to guarantee such a claim:  The thread doing the reading may see the individual updates in any order, and so the estimate may be an over- or an underestimate.

It would fix this and simplify things a lot to take the special case for timeout==0 out of the code.

----------

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


More information about the Python-bugs-list mailing list