This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kristjan.jonsson
Recipients kristjan.jonsson, pitrou
Date 2010-04-15.20:35:39
SpamBayes Score 8.454681e-07
Marked as misclassified No
Message-id <1271363743.96.0.308083925586.issue8411@psf.upfronthosting.co.za>
In-reply-to
Content
As per Antoine's suggestion, here is a patch to improve condition variable emulation on windows.

By using the windows Semaphore (which hasn't always been available) all of the problems in emulating condition variables using Events disappear.  in particular, the "lost wakeup" bug can be elimintated, and the same object easily supports bot the "signal" and "broadcast" mode of waking up threads.  We can also use the CRICITAL_SECTION objects as the associated mutex which is much lighter weight than using a kernel object.

I do think I´ve caught all the corner cases.  It is also simpler to prove because this construct is simpler than the previous one.  If, however, i have missed a spot, I'd be interested to know about it.  Not completely impossible since race conditions are devious beasts.  Ive tested this extensively on Windows.

See also issue 8299 where this implementation was presented.
History
Date User Action Args
2010-04-15 20:35:45kristjan.jonssonsetrecipients: + kristjan.jonsson, pitrou
2010-04-15 20:35:43kristjan.jonssonsetmessageid: <1271363743.96.0.308083925586.issue8411@psf.upfronthosting.co.za>
2010-04-15 20:35:42kristjan.jonssonlinkissue8411 messages
2010-04-15 20:35:41kristjan.jonssoncreate