Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-01-24 10:08:37


Kowalke Oliver (QD IT PA AS <Oliver.Kowalke <at> qimonda.com> writes:

> will shared_mutex replace read_write_mutex?

Yes.

> Where can I reasd more about the usage of shared_mutex
> (http://svn.boost.org/svn/boost/trunk/libs/thread/doc/ doesn't contain an
explanation)?

It will be in the new docs when I get them finished. In the meantime, you can
read Howard's papers presented to the C++ Standards committee:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html --- original
proposal featuring shared_mutex
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2406.html --- rational
which includes shared_mutex discussion.

Note that boost::shared_mutex currently includes the upgrade_mutex behaviour.

Basically unique_lock<shared_mutex> will give you a write lock,
shared_lock<shared_mutex> will give you a read lock, and
upgrade_mutex<shared_mutex> will give you a read lock than you can upgrade by
transferring ownership (with move) to a unique_lock<shared_mutex>.

Anthony


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