From: Jive Dadson (djones_at_[hidden])
Date: 2002-05-25 17:27:26
I want to apologize for stirring up a hornets' nest with my question
about semaphores. It never ocurred to me that such a hoary subject ;-)
would remain controversial in 2002.
I might mention, parenthetically, that I am in the process of designing
a system that will run on two platforms. One is MS Windows. The other
is a realtime OS. The realtime OS does not come with POSIX condvars,
but it does have implementations of most of the MS Windows stuff. (It
WaitForMultipleObjects.) When running on the realtime OS, the program
will be mission critical, and will have a so-called "hard" realtime
layer. It was with this new design in mind that I asked the original
I'd like to ask a favor of you folks. Can anyone point me to an essay,
USNIX article, FAQ, or whatever that contains a lucid description and
*examples* of the horrors which await those who use semaphores? I'd
like to understand just what all the brouhaha is about.
It is clear to me that, on the face of it, condvars are more general. I
say, "on the face of it," because the fact that Boost.Threads implements
condvars in terms of MS Windows CRITICAL_SECTION's and semaphores,
albeit inefficiently, demonstrates that the two mechanisms have equal
power. What is not clear to me is why some people call semaphores "BAD"
in all caps. I've used them since 1979 without any disasters so far.
I want to emphasize that I am asking for my own education, not to stir
up trouble. With that in mind, I suggest that "these proceedings are
closed." If you would be kind enough to do me a favor and direct my
attention to some article that has examples of the semaphore's dark
side, please email me at jdadson_at_ix.netcom.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk