Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"07-08-11 - Event Count and Condition Variable"

5 Comments -

1 – 5 of 5
Blogger Branimir Karadžić said...

>>"Unfortunately, on Win32 you don't have condition_varaiable at all"

Check this out:
http://msdn.microsoft.com/en-us/library/ms683469%28v=vs.85%29.aspx

It maps 1:1 to pthread_cond_*...

InitializeConditionVariable == pthread_cond_init
WakeConditionVariable == pthread_cond_signal
WakeAllConditionVariable == pthread_cond_broadcast
etc.

July 8, 2011 at 10:36 PM

Blogger cbloom said...

Yeah, I know. It's nice, but it's Vista+ which means as a software writer you just can't use it.

July 8, 2011 at 10:39 PM

Blogger cbloom said...

BTW when I say "Win32" I mean "pre-Vista" because if you're Vista+ you should be running 64 bit and then I refer to it as "Win64".

It's way too much pain in the ass to deal with all the possible permutations of clients, so I simplify it to :

"win32" :
Win95+
32 bit
no SSE gaurantee

"Win64" :
Vista+
64 bit
has at least SSE2
has cmpx128 (*)

(*) = if you are in the weird gap of 64-bit chips that don't have cmpx128 I hate you and you get treated as win32

July 8, 2011 at 10:46 PM

Blogger Branimir Karadžić said...

Ah ok, I still call everything WIN32. :)

July 8, 2011 at 11:00 PM

Blogger cbloom said...

A related problem is

SignalObjectAndWait

which would be a lovely function to use for implementing condition_var (it basically is the heart of condition var - it signals one handle and waits on another handle in one op), but it's Win2k+ only so it's slightly better than Vista+ but still not actually usable in code that has to work on any Windows.

I don't really understand who is writing code that knows they can use Vista+ only APIs. I guess people who release many versions for various hardware/OS combos.

July 8, 2011 at 11:18 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.