|
Boost : |
Subject: Re: [boost] Atomic Shared Ptr
From: Peter Dimov (lists_at_[hidden])
Date: 2017-06-17 20:49:30
Gottlob Frege wrote:
> > https://github.com/boostorg/smart_ptr/commit/2964ed2379cf47778b18954b8d3501fa940c8754
>
>
> 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/67d897a5330e99821adcebc82f605dd1d62b4fde
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).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk