Boost logo

Boost :

From: Sean Kelly (sean_at_[hidden])
Date: 2004-01-27 20:47:15


On Mon, 26 Jan 2004, Hurd, Matthew wrote:
>
> So are you saying that multiple threads calling WaitForSingleObject for
> the same event is not safe or is the lack of safety elsewhere in the
> windows event mechanism. I wouldn't mind a source url or something for
> this if you have one so I can come up to speed.

Aside from the papers linked to in the Boost.Thread documentation, the
best thing to do is search comp.programming.threads for "windows" and
"event." The discussion has come up there quite a few times, including
some of the original talk about the Boost.Thread implementation.
Alexander Terekhov (from this list) is involved in most of the discussions
so you could search on his name as well.

One such link is here:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=3e2ae910%240%245363%249b4e6d93%40newsread4.arcor-online.net&rnum=5&prev=/groups%3Fq%3Dwindows%2Bevent%2Bgroup:comp.programming.threads%26hl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.programming.threads%26selm%3D3e2ae910%25240%25245363%25249b4e6d93%2540newsread4.arcor-online.net%26rnum%3D5

By the way, I'm not saying that WaitForMultipleObjects is broken so much
as that Windows events seem to be broken once you get beyond the fairly
simple cases. Waiting on a mutex in Windows uses the WaitForObject calls
as well, so I don't think the function itself is at issue.

> I think WSFU if a crimson herring, best to forget about it.

I don't think I'd ever want to require a customer to install WSFU to use
my application, but from the documentation it seems quite solid. Rather
than Win32 wrappers (ala Cygwin) it's actually an entire subsystem that
contains a full posix implementation. I haven't done much more than skim
the docs, but it's at least worth some play-time.

As for the rest... I like to come to my own conclusions and an still
reading up on the details in my rather limited free time. I will freely
admit that I would be more likely to use the Boost condvar implementation
everywhere rather than in just the complcated cases if I could safely do
away with a large chunk of the code. I guess what I want is for someone
to prove to me that the solution really does need to be as complex as it
seems :)

Sean


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk