19 Jun
2017
19 Jun
'17
12:16 p.m.
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.