Condition Variables under Win32
28/May 2008
If you’ve been programming POSIX threads (or Java, C#, D…), chances are you’ve used condition variables. It’s also probable that after that you switched to Win32 and found nasty surprise - no “native” condition variables here. Of course, they can be implemented with help of other synchronization primitives, but it’s not for the faint-hearted (I’ve to read this article in small portions, like 10% at a time, otherwise my head starts exploding). Dont abandon the hope, however. It turns out that Vista introduces support for condition variables. Of course, if you’d like your application to run under any other system, you’ll have to implement it anyway, but they’re cool for Vista-only experiments. I’ve made some rough tests and they seem to work OK. Make also sure to read about some other new synchronization primitives in Vista (like SRW lock).
[Edit] There are condition variables (implemented in a way similar to described in Schmidt’s article - generation count) in Boost as well, but using them means including zillion of headers (as usually with Boost).
Old comments
Pages tagged “the primitives” 2008-06-01 21:34:27
[…] the primitivesOwn a Wordpress blog? Make monetization easier with the WP Affiliate Pro plugin. Condition Variables under Win32 saved by 5 others SterlingSolomon bookmarked on 06/01/08 | […]