|
Boost : |
From: William Kempf (sirwillard_at_[hidden])
Date: 2000-08-08 10:12:08
--- In boost_at_[hidden], Valentin Bonnard <Bonnard.V_at_w...> wrote:
> Andy Sawyer wrote:
>
> > I concur. "P" and "V" are only interesting from the
archaeological
> > viewpoint.
>
> I prefer these names because they are so strange and specific that
> they show very clearly what we are talking about.
They can only "show very clearly what we are talking about" if they
are meaningful to begin with. What if the iostreams implementation
had chosen G instead of get(). To me it's worse here, because P and
V are not abbreviations for words in my native language, though I
know that this is a rather ego-centric reaction.
> lock() can lock a file, lock an exclusive lock, enter some
> other sort of critical section.
>
> I like the names P and V because they don't mean anything to most
> people, but I dislike semaphores because I have never understoud
> how they were meant to be used. (I don't see the specific problem
> they solve.)
P and V were really meant for semaphores so using them for a simpler
mutex will only further add to the confusion.
Because there seems to be some confusion here, I'll restate my own
working definitions for mutex and semaphore.
A mutex is a synchronization object designed to allow mutually
exclusive access to a resource.
A semaphore is a synchronization object designed to allow access to a
resource to a fixed number of owners. (This one needs work, but
worded the way I did here it shows the distinction between a mutex
and a semaphore).
Issues such as re-entrancy (recursion) are an implementation detail,
not actually part of the definition of the term. Same for the name
of the operations available, and to some extent the operations
available (for instance, a try_lock is not a requirement by the
definition of the term, but is a very useful implementation detail).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk