Is it possible to implement atomic swap for smart pointers on x86/x86-64 without using of transactional memory. Especially interested in atomic exchange for shared_ptr.
There are CMPXCHG8B and CMPXCHG16B instructions on modern processors. Can they be used to implement atomic swap for shared_ptr?