RE: [sv-ec] [sv-bc] Semaphore question

From: Cliff Cummings <cliffc_at_.....>
Date: Tue Sep 20 2005 - 08:06:46 PDT
Hi, Jonathan -

Thanks for the reply. I agree that semaphores may not be best suited for
the examples I gave, but I am trying to figure out reasonable use-models
for the available semaphore capabilities.

Seems like taking and putting a single key will be the most common
use-model, but I tried to figure out what reasons might exist for taking
and putting multiple keys or putting extra keys into the bucket.

If only the simple use-model were applicable, why did somebody add the
other capabilities as opposed to adding safeguards that would keep
engineers from requesting multiple keys or putting back more keys than
they have taken?

Any use-model thoughts? You have seen my feeble attempt to come up with
examples of possible usage.

Regards - Cliff

--- Jonathan wrote ---------------------------------------
Whilst we obviously need to clarify the defined behaviour,
for my $0.02 you're abusing semaphores here: it's a very
low-level synchronization construct, and what you're
suggesting smacks of using a buggy whip as a cruise control.
Be grateful that at last we have a reliable mutex, and
write custom resource control classes to do the interesting
things you describe; these classes can use one or more
semaphores, or mailboxes, in straightforward ways.


Just my bigoted opinion as usual :-)
-- 
Jonathan Bromley, Consultant
Received on Tue Sep 20 08:06:50 2005

This archive was generated by hypermail 2.1.8 : Tue Sep 20 2005 - 08:07:01 PDT