Boost logo

Boost :

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


In message <8mska9+t7sl_at_[hidden]>, William Kempf <sirwillard_at_my-
deja.com> writes
[Jeremy's generics]
>Ahhh... the light goes on. Sorry, I've not seen this approach to
>design. When "generic programming approach" was stated I took this
>too mean the implementation should be done through templates.

Sorry, I wasn't clear. Fortunately, however, Jeremy was. This is what I
meant by STL-based approach: the reqs framework rather than the 'T'
element.

>The
>generic approach from this document seems to mean that the
>implementation is not defined at all, and only certain parts of the
>interface are specified. The "mutex" may not be a template, but the
>mutex concept is applicable to varying concrete types that may be
>used in templates. Do I have this right?

Yup. Having this set of reqs means that (2) users and developers have a
common model to program to/from, and (1) they can be used in templates
(ie adaptor style, and for example used to param higher level classes).

>The documents look nice, and I like the approach taken for the
>try_lock. I'm still curious if a timed_lock should be considered.

Yes, but should that probably wait for the next round? On that very
topic, the one question that has to be answered (programmatically rather
than metaphysically) is what do we mean by _time_? What interface should
be used for time intervals?

>The only comment I'd make on the docs as written at this time is that
>the destructors may need a precondition. It's possilbe (though
>probably not desirable) to create the lock on the heap and pass it to
>another thread which deletes it. This means a thread is attempting
>to remove a lock that it doesn't own, which probably should be an
>error?

I think that this falls into the realm of "undefined behaviour" :->
(This should be stated in the docs, I guess)
____________________________________________________________

  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