Hi, Does Boost have anything like concurrency TS' atomic_shared_ptr? Gr, -- Olaf
Hi,
Does Boost have anything like concurrency TS' atomic_shared_ptr?
No, only http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2632.html
On Fri, Jun 16, 2017 at 2:42 PM, Peter Dimov via Boost
Hi,
Does Boost have anything like concurrency TS' atomic_shared_ptr?
No, only http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2632.html
Any plans to add it? IMO it'd be nice to have. -- Olaf
Olaf van der Spek wrote:
On Fri, Jun 16, 2017 at 2:42 PM, Peter Dimov via Boost
wrote: Hi,
Does Boost have anything like concurrency TS' atomic_shared_ptr?
No, only http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2632.html
Any plans to add it? IMO it'd be nice to have.
Sure, why not. https://github.com/boostorg/smart_ptr/commit/2964ed2379cf47778b18954b8d3501f...
On Fri, Jun 16, 2017 at 11:39 AM, Peter Dimov via Boost
Olaf van der Spek wrote:
On Fri, Jun 16, 2017 at 2:42 PM, Peter Dimov via Boost
wrote: Hi,
Does Boost have anything like concurrency TS' atomic_shared_ptr?
No, only > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2632.html
Any plans to add it? IMO it'd be nice to have.
Sure, why not.
https://github.com/boostorg/smart_ptr/commit/2964ed2379cf47778b18954b8d3501f...
I have enormous faith in you, however, this is the simplest implementation I've seen. I assume that is because it is not lock-free? Or is it because it doesn't actually work? Tony
Gottlob Frege wrote:
https://github.com/boostorg/smart_ptr/commit/2964ed2379cf47778b18954b8d3501f...
I have enormous faith in you, however, this is the simplest implementation I've seen. I assume that is because it is not lock-free? Or is it because it doesn't actually work?
I made it a bit more complex: https://github.com/boostorg/smart_ptr/commit/67d897a5330e99821adcebc82f605dd... The reason it was so simple was because it was using the already existing atomic functions. And no, it's not lock-free. Lock-freedom requires significantly more complexity (and a double-width CAS).
On Sat, Jun 17, 2017 at 10:49 PM, Peter Dimov via Boost
I made it a bit more complex:
Hi Peter, Wow, that was fast. Thanks!
The reason it was so simple was because it was using the already existing atomic functions. And no, it's not lock-free. Lock-freedom requires significantly more complexity (and a double-width CAS).
Why not improve the existing functions and keep using those? -- Olaf
Olaf van der Spek wrote:
On Sat, Jun 17, 2017 at 10:49 PM, Peter Dimov via Boost
wrote: I made it a bit more complex:
Hi Peter,
Wow, that was fast. Thanks!
You're welcome. :-)
The reason it was so simple was because it was using the already existing atomic functions. And no, it's not lock-free. Lock-freedom requires significantly more complexity (and a double-width CAS).
Why not improve the existing functions and keep using those?
Since atomic_shared_ptr is a separate type, there's room for it for a spinlock, which on balance is a bit better than using a separate spinlock pool as the free functions do.
participants (3)
-
Gottlob Frege
-
Olaf van der Spek
-
Peter Dimov