Boost logo

Boost Users :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2004-02-20 15:57:09


At Thursday 2004-02-19 15:02, you wrote:
>"Victor A. Wagner, Jr." <vawjr_at_[hidden]> wrote in message
>news:6.0.3.0.2.20040219140935.0448ef10_at_mail.rudbek.com...
[deleted]
> > >
> > >Which one? Signal handler or inter-process communication?
> >
> > does it really matter? semaphores are useful (and can be misused,
>like a
> > lot of other things in life). Why the resistance to putting them
>in?
>
>For my part, I don't really have a strong opinion one way or the other
>yet, but even if I decided I strongly supported adding semaphores to
>Boost.Thread, I wouldn't have time to do anything about it for quite a
>while. Are you (or is anyone else) willing to submit a design that
>minimizes the possibilities of misuse, since that appears to be the
>main concern?

I'm not sure what "misuse" has everyone concerned.

> And, if Boosters like the design, are you (or is anyone
>else) willing to implement it on the same platforms supported by the
>current Boost.Thread? And write documentation that clearly states the
>intended use cases and drawbacks of semaphores?

given that I don't think there are any drawbacks, and the limitations are
obvious to anyone who reads what they do, I'll have difficulty doing this.
Semaphores are _very_ low level components and often used to construct
other interlocks.

> And write unit tests,
>examples, etc.?
>
>Perhaps one way to limit the possibilities for misuse would be to
>create a class or classes that, instead of directly exposing semaphore
>functionality, somehow supports the main use cases for semaphores?

We used them _mostly_ encapsulated, but our theory was "If it's useful for
us, maybe it's useful for our customers also". We were selling embedded
mini-computers and a small RTX. Although I wasn't the architect of the
RTX, it became my sole responsibility shortly after version 1.0 was
delivered to us. The next two generations of real-time kernel/OSs also
used semaphore as the basis for all of the interlocks....and we made them
available to our customers also.

> I
>don't really have a clear idea what this would mean--I'm just thinking
>out loud.
>
>Any ideas?

not any more, really.
I would like to note that we had to write all this stuff in languages that
were NOT typesafe (ASM, BCPL, C) and if someone "told us" that something
was a semaphore, we blindly did the "semaphore stuff" on the block of
memory referenced. I don't recall anyone ever complaining that it wasn't
"safe". Of course, any program could have cleared (filled with 0s) all of
memory back then, so any safety we could have added would have been
somewhat illusory. I really believe the same still holds, and would
appreciate anyone who thinks that semaphores are "unsafe" to give me a real
world example of the possible harm.

>Mike
>
> > >- Volodya
> > >
> > >
> > >_______________________________________________
> > >Boost-users mailing list
> > >Boost-users_at_[hidden]
> > >http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
> > Victor A. Wagner Jr. http://rudbek.com
> > The five most dangerous words in the English language:
> > "There oughta be a law"
>
>
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net