Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-08-10 11:29:45


In message <200008091944.OAA13216_at_[hidden]>,
jsiek_at_[hidden] writes
>Ok, to help people get a feel for what we want, I've written up a
>strawman concept description for Mutex and ReentrantMutex.
>
>http://www.lsc.nd.edu/~jsiek/Mutex.html
>http://www.lsc.nd.edu/~jsiek/ReentrantMutex.html

Looking good. This is pretty much along the lines I was thinking, with a
few tweaks.

>Note that with a generic programming approach, when creating concepts
>it is better to create lots of fine-grained concepts instead of large
>kitchen-sink concepts.

Agreed.

>For example, the two concepts I've defined do
>*not* say how to create a mutex object, whether by default constructor
>or with a name or otherwise. This is left to other concepts.

I think baseline, default creatability is actually quite important -- I
expect to be able to parameterise higher level classes (eg monitor-based
ones) using them and there have to be some core reqs that allow for
common creation. At the same, I appreciate that there are many ways to
skin these cats and not all creation concepts can (or should) be in the
core reqs.

>One
>thing people may want to debate is splitting Mutex even further to
>separate out the support of try locks into a different concept.

This is the scheme I have currently sketched. What I have done is
separate out different basic lockability concepts, and refined their
semantics accordingly.

>Also note that having different "valid expressions" is not the only
>thing that differentiates concepts. Semantics, complexity guarantees,
>etc. can also make a difference. I've defined Mutex and ReentrantMutex
>as different concepts even though they look exactly alike... its just
>that their use and behaviour is different enough to highlight with
>different concept names. Note the differences under semantics and
>pre/post conditions.

Yup, this is the approach I had in mind. Looks good.
____________________________________________________________

  Kevlin Henney phone: +44 117 942 2990
  Curbralan Ltd mobile: +44 7801 073 508
  kevlin_at_[hidden] fax: +44 870 052 2289
____________________________________________________________


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