Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-08-10 23:26:04


> From: "Mark Rodgers" <mark.rodgers_at_[hidden]>
>
>From: "Kevlin Henney" <kevlin_at_[hidden]>
>>
>> Can I just clarify, is the nested lock type just a tag? In other words,
>> does nothing else?
>
>The category is just a tag, but the mutex::lock would be the normal
>scoped guard object. I was thinking more in terms of algorithms or
>function that might change depending on what you can do with the lock.

There is no reason for the scoped guard class to be nested: this reduces
the (re)usabilty of such classes. The scoped guard class I have in mind
is external and templated on anything that is lockable. This has the
benefit of (1) being more generic and (2) reduces the code required to
write a synchronised class.

See http://www.two-sdg.demon.co.uk/europlop for a paper that includes
examples along these lines (as well as a couple of the other topics
addressed here).
____________________________________________________________

  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