Does anybody know of a fully thread-safe shared_ptr implementation? E.g. boost implementation of shared_ptr is thread-safe for the targets (refcounting
This may not be exactly what you want, but the boost::atomic documentation provides an example on how to use an atomic counter with intrusive_ptr. intrusive_ptr is one of the Boost smart pointers, it does "intrusive reference counting", which means the counter is "embedded" in the target instead of providing by the smart pointer.
Boost atomic Usage Examples:
http://www.boost.org/doc/html/atomic/usage_examples.html