Subject: Re: [boost] [thread] On shared_mutex
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2010-11-28 17:44:21
glad to see that you are working on this.
Howard Hinnant-3 wrote:
> Three years ago I wrote N2406 "Mutex, Lock, Condition Variable Rationale"
> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2406.html) for
> the C++ committee in an attempt to explain the combined proposed
> std::mutex/std::unique_lock package and how it fit together with the
> tr2-targeted shared_mutex/shared_lock package. This paper also proposed
> an upgrade_mutex and upgrade_lock.
> Since that time, the std-proposed stuff has been accepted with some name
> changes, and a reworking of the timed-locking interface. Additionally
> Anthony Williams has implemented much of the shared-locking functionality
> in boost (and done a very nice job with it).
> That being said, I disagree with some fairly major design changes between
> N2406 and what is now in the boost library. Four of the major changes
> 1. upgrade_mutex has been dropped.
> 2. Some, but not all of the functionality in upgrade_mutex has been moved
> into shared_mutex.
> 3. Some of the upgrade_mutex functionality is missing completely. The
> missing functionality is summarized in the "Ownership Modes" charts in the
> form of red arrows.
> 4. boost allows implicit conversions between the lock types. N2406 made
> these conversions explicit. Rationale: changing the ownership mode of a
> mutex is something that should be well documented in the code.
Some weeks ago I proposed to Anthony and Ion to unify the synchronization
parts of Boost.Thread and Boost.Interprocess and try to follow C++0x as
close as possible, using Boost.Move, Boost.System and Boost.Chrono (if
I had a positive answer from Ion. Ion was interested in preserving backward
compatibility and in maintaining his Interprocess library header only, so I
tried to make Boost.System and Boost.Chrono configurable either as a header
only library or a dynamic library. Unfortunately Boost.Move has not been
accepted yet neither. We need to see how backward compatibility can be
preserved as there are a lot of differences between both interfaces.
I guess you know already that Boost.Interprocess interface is quite close to
N2406 and also to your design.
> I have an updated implementation of <shared_mutex> (under the boost
> license) here:
Thanks for sharing all these material with us.
-- View this message in context: http://boost.2283326.n4.nabble.com/thread-On-shared-mutex-tp3062751p3062860.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk