Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-08-09 14:44:02


Dietmar Kuehl writes:
> --- Kevlin Henney <kevlin_at_[hidden]> wrote:
> [lots on a generic approach]

Of course I'm also highly in favor of a steering the boost thread
discussion into a more generic programming approach.

> > I'm happy to work out a strawman doc based on this idea and building
> > on Dietmar's definition's doc, if anyone's interested.
>
> I would greately appreciate if I wouldn't be required to write
> everything :-) However, I can offer support on this, be it in form of
> ideas with respect to requirements, reviews, htmlization of text, etc.

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

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. 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. One
thing people may want to debate is splitting Mutex even further to
separate out the support of try locks into a different concept.

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.

One last thing... I suggest the use of terminology from Matt Austern's
book, "Generic Programming and the STL" when it comes to generic
programming. Use "concept" instead of "interface" and use "model" to
describe the relationship between a concrete type and concepts for
which it meets the requirements. Use "refine" to describe the
relationship between a concept that adds on to another concept.

Cheers,

Jeremy

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame cell phone: (415) 377-5814
----------------------------------------------------------------------


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