|
Boost : |
From: Nicolas Fleury (nfleury_at_[hidden])
Date: 2003-06-04 14:53:52
Alexander Terekhov wrote:
> Nicolas Fleury wrote:
> [...]
>
>>
>>Would it be possible to post some code that "experience has shown" to be
>>error-prone using semaphores comparing with conditions/mutexes?
>
>
> Sure... thanks to the Microsoft Corp.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndllpro/html/msdn_metrsect.asp
>
> Take a look at their brain-damaged "metered section" semaphore
> implementation. Note that MS "auto-reset event" is nothing but
> a binary sema (well, brain-dead "pulsing" aside for a moment).
Thx for the link, but I don't get it. How is Microsoft implementation
of semaphore is showing that all implementations of semaphore should be
avoided? Using semaphores versus using mutexes/conditions should be
illustrable with few lines of code. I just want to understand what some
developers think is error-prone about semaphores, whatever the
implementation (or with the removed boost implementation).
Thx.
Regards,
Nicolas Fleury
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk