Boost logo

Boost :

From: William Kempf (sirwillard_at_[hidden])
Date: 2000-08-10 10:36:37


--- In boost_at_[hidden], "William Kempf" <sirwillard_at_m...> wrote:
> --- In boost_at_[hidden], "Greg Colvin" <gcolvin_at_u...> wrote:
> > From: "William Kempf" <sirwillard_at_m...>
> > > --- In boost_at_[hidden], "Greg Colvin" <gcolvin_at_u...> wrote:
> > > > What is the simplest, safest language construct we know of
for
> managing
> > > > concurrent access to data? I would say the monitor, as
> developed and
> > > > described by Per Hansen and Tony Hoare in the 1970s, and
> implemented in
> > > > many programming languages since then. The classic 1974
paper
> by Hoare
> > > > remains one of the best introductions
> > > > http://www.acm.org/classics/feb96/
> > > > and Hansen's 1993 review is also very useful
> > > >
http://www.acm.org/pubs/citations/proceedings/plan/154766/p1-
> hansen/

I've taken a look at the classic 1974 paper by Hoare, and this paper
has a very good example of why the simplistic monitor you've
described can not be a replacement for conditions. He's got an
example of a read/write lock implemented using his concept of a
monitor. The implementation requires two conditions. I'm not sure
that a monitor deserves first class implementation in a C++ library
given this. The monitor as Hoare describes it may simply be a
programming idiom used with mutexes and conditions. That's
definately something that's up to debate, but I think I've proven to
myself that we can't do with out the primitives mutex and condition
just because we include a monitor.

I tried to look at Hansen's 1993 review, but I'm no longer an ACM
member and so don't have access to it. (I dropped membership after
graduating in '92).

William Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk