std::atomic_shared_ptr

Thomas Rodgers rodgert@appliantology.com
Wed Jun 2 15:03:47 GMT 2021


On 2021-06-02 07:37, Mikhail Matrosov wrote:

>> Probably not, because it would require ABI-breaking changes to
> std::shared_ptr, which is out of the question.
> 
> Could you please elaborate on that? I can see how folly uses 
> std::shared_ptr directly:
> 
> https://github.com/facebook/folly/blob/master/folly/concurrency/AtomicSharedPtr.h#L76
> https://github.com/facebook/folly/blob/master/folly/concurrency/detail/AtomicSharedPtr-detail.h#L45
> 
> -----
> Best regards, Mikhail Matrosov

I've yet to be convinced that this type warrants the extra complexity 
doing so would entail, and if I did decide to incur that level of
complexity, I would likely go a different route (see comments in folly 
re: corner cases). Either way, GCC12 won't commit to any ABI for
this, GCC13 might, and the details can change between the two releases.


More information about the Libstdc++ mailing list