Boost logo

Boost :

From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-06-07 17:20:35


Stefan Seefeld said:
> William E. Kempf wrote:
>
>> As soon as synchronization relies on *BOTH* a mutex and a sema/event,
>> you've got a race condition.
>
> hmm, I'm not sure I have the same definition for 'race condition' as you
> have. Of course I could write non-safe code that presents a race
> condition. Is your point that you want to make it impossible to write
> non-thread-safe code ?

If only that were possible. No, that's not my point. But semas/events
are certainly difficult enough to use in all but the simplest cases that
they were removed from the library.

> Or are you claiming that the code I have shown contains a race condition
> (which I still don't see) ?

I haven't seen your code to say for sure, but from the limited description
I believe there's a very high probability that this is the case.

-- 
William E. Kempf

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