atomic_shared_ptr relationship with std::shared_ptr

96 views
Skip to first unread message

Noah Watkins

unread,
Jun 28, 2017, 4:09:07 PM6/28/17
to Folly: the Facebook Open-source LibrarY

I noticed that the atomic_shared_ptr was moved out of experimental. Very exciting!


At first I was expecting something that looked like a stand-alone drop in for std::shared_ptr, but after examining the unit tests I see that there is a relationship between atomic_shared_ptr and std::shared_ptr, and it's not immediately clear how to two relate, and how they should be used together. Is there some additional information related to the use of atomic_shared_ptr other than the unit tests?


The immediate questions I had after taking a look around was (1) is there a required pattern such as: create a std::shared_ptr and then arrange for all threads to interact via an atomic_shared_ptr, (2) is it possible to use the Deleter template parameter of std::shared_ptr in conjunction with atomic_shared_ptr, and (3) is there some interoperability with std::weak_ptr?


Best,

Noah

Reply all
Reply to author
Forward
0 new messages