What is the difference between std::shared_ptr and std::atomic aka. std::experimental::atomic_shared_ptr?
The atomic “thing” in shared_ptr is not the shared pointer itself, but the control block it points to. meaning that as long as you don’t mutate the shared_ptr across multiple threads, you are ok. do note that copying a shared_ptr only mutates the control block, and not the shared_ptr itself. std::shared_ptr<int> ptr = std::make_shared<int>(4); for … Read more