|
Threads-Devel : |
Subject: Re: [Threads-devel] Threading features
From: Anthony Williams (anthony_at_[hidden])
Date: 2009-01-08 16:03:12
At Thu 08 Jan 2009 20:53:47 UTC, mlimber <mlimber_at_[hidden]> wrote:
> First, I'm wondering why the UpgradeLockable concept (and hence its
> associated locks) doesn't support timed locking like SharedLockable
> does. And if it's not unfeasible for some reason, is there a plan to
> add this?
Timed locks are a real pain. It's probably feasible, but I don't feel
the need to do it myself, as I wouldn't ever use it.
> Second, I see that there has been some discussion of adding a
> locking_ptr akin to Alexandrescu's code in "volatile - Multithreaded
> Programmer's Best Friend" (http://www.ddj.com/cpp/184403766), but
> taking into to account his semi-retractions about using volatile in
> his non-Standard way (http://www.ddj.com/cpp/184403774) and
> substituting a set of class templates for non-intrusive locking that
> would correspond directly to the Boost.Thread mutex concepts -- e.g.,
> lockable<T>, shared_lockable<T>, etc. Each *lockable<T> instance would
> own an object of type T and would expose it through a
> lockable<T>::locking_ptr, shared_lockable<T>::shared_locking_ptr,
> shared_lockable<T>::unique_locking_ptr, etc. to help prevent locking
> errors.
>
> I, and a goodly number of other users over the years, have
> concurrently developed similar classes to leverage RAII and data
> hiding in order to reduce locking errors. Seems like a good place to
> standardize common practice. Anyone know what the status of such a
> project is?
This has been discussed several times, but I'm not aware of any plans
for a boost submission.
Anthony
-- Anthony Williams Author of C++ Concurrency in Action | http://www.manning.com/williams Custom Software Development | http://www.justsoftwaresolutions.co.uk Just Software Solutions Ltd, Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK