Boost logo

Threads-Devel :

From: Anthony Williams (anthony_at_[hidden])
Date: 2008-02-01 02:49:01


Quoting Constantine Sapuntzakis <csapuntz_at_[hidden]>:

> Do you know where I can comment with respect to the standards document?

The proposals and working draft are available from
http://www.open-std.org/jtc1/sc22/wg21/

If you wish to comment, members of the C++ Standards committee hang
out on the comp.std.c++ newsgroup, so comments there will be heard. If
you have specific comments on the threads proposals, you can let me
know, and I'll let the rest of the team working on this area aware of
your concerns.

If you wish to be more seriously involved, contact your country's
Standards body and ask to be involved. In the US it's ANSI, in the UK
it's BSI, in Germany it's DIN, and in France it's AFNOR (I hope I
remembered those correctly). Other countries will have their own
standards body.

> Apropos your point about consistent pairs: I almost never use
> scoped_lock::lock. I always get
> the lock as a side effect of the scoped_lock constructor. However, I do
> often
> call scoped_lock::unlock to release the lock before the scope ends. So I
> need to remember: is the scoped_lock::acquire/release or is it
> scoped_lock::lock/unlock?

Point taken, but there's a hint in the name: scoped_*lock*

> I'm curious: what are the uses for scoped_lock::release?

Transfer of ownership. Though the lock types are movable, sometimes
that's not sufficient --- e.g. if you wish to transfer ownership to a
user-defined lock type, or if the lifetime of the scoped_lock object
ends before you wish to unlock the mutex.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk