我阅读了 Antony Williams 的以下 文章,据我了解,除了 中的 std::experimental::atomic_shared_ptr std::shared_ptr 中的原子共享计数之外,指向共享对象的实际指针也是原子的吗?但是,当我阅读 lock_free_stack 在Antony 的关于 C++ 并发 的书中描述的参考计数版本时,在我看来,同样适用于 std::shared_ptr ,因...
std::experimental::atomic_shared_ptr constexpr atomic_shared_ptr() noexcept; (1) constexpr atomic_shared_ptr( shared_ptr<T> desired ) noexcept; (2) atomic_shared_ptr( const atomic_shared_ptr& ) = delete; (3) Constructs a new atomic_shared_ptr object. 1) The default constructor ...
stores a value into anatomic_shared_ptrobject (public member function) std::atomic_is_lock_free(std::shared_ptr)std::atomic_load(std::shared_ptr)std::atomic_load_explicit(std::shared_ptr)std::atomic_store(std::shared_ptr)std::atomic_store_explicit(std::shared_ptr)std::atomic_exchange(s...
std::experimental::atomic_shared_ptr<T>:: shared_ptr<T>load(std::memory_orderorder=std::memory_order_seq_cst)constnoexcept; Atomically loads and returns the current value of theatomic_shared_ptr. Memory is affected according to the value oforder....
std::experimental::atomic_shared_ptr operator shared_ptr<T>() const noexcept; Atomically loads and returns the current value of the atomic_shared_ptr. Equivalent to load(). Parameters (none) Return value The current value of the atomic_shared_ptr. Remarks All associated use_count increme...
_exchange(std::shared_ptr)std::atomic_exchange_explicit(std::shared_ptr)std::atomic_compare_exchange_weak(std::shared_ptr)std::atomic_compare_exchange_strong(std::shared_ptr)std::atomic_compare_exchange_weak_explicit(std::shared_ptr)std::atomic_compare_exchange_strong_explicit(std::shared_ptr...
true if the atomic operations on the objects of this type are lock-free, false otherwise. See alsostd::atomic_is_lock_free(std::shared_ptr)std::atomic_load(std::shared_ptr)std::atomic_load_explicit(std::shared_ptr)std::atomic_store(std::shared_ptr)std::atomic_store_explicit(std::...