This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: atomic operations for shared_ptr ?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Bronek Kozicki <brok at spamcop dot net>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 24 Aug 2013 18:51:37 +0100
- Subject: Re: atomic operations for shared_ptr ?
- References: <5218F14F dot 9080804 at spamcop dot net>
On 24 August 2013 18:45, Bronek Kozicki wrote:
>
> what are the current plans for supporting atomic_* free functions for
> shared_ptr, as defined in C++11 (20.6.2 "Header <memory> synopsis")? These
> would be very useful for passing shared_ptr objects between threads, esp. if
> there are multiple readers and single writer.
I've been thinking about it recently and am probably just going to
implement it with a single global mutex used for all shared_ptr
instances.
I haven't looked into how easy it would be to modify our
implementation to support those operations without locks.