3 ms·
> I want the equivalent of atomic<shared_ptr<T>>, but lock-free. You can do that without transactions with a lock cmpxchg16b instruction, or with a more compli
by ot 7y ago
> I want the equivalent of atomic<shared_ptr<T>>, but lock-free.
You can do that without transactions with a lock cmpxchg16b instruction, or with a more complicated algorithm like this:
https://github.com/facebook/folly/blob/3de8f357eecaff89e3847fdb4f090767c2d42e81/folly/concurrency/AtomicSharedPtr.h https://github.com/facebook/folly/blob/3de8f357eecaff89e3847...
- MaxBarraclough 7y agoIs there a reason a standard-compliant implementation of atomic<shared_ptr<T>> couldn't use that approach? Or is it just a matter of someone doing it?