An atomically‐swappable owner of a ReadMostlyMainPtr.
Synopsis
Declared in <folly/concurrency/memory/AtomicReadMostlyMainPtr.h>
template<typename T>
class AtomicReadMostlyMainPtr;
Description
What atomic_shared_ptr is to shared_ptr, this is to ReadMostlyMainPtr: it allows racy conflicting accesses to one, giving true shared_ptr‐like semantics, including reclamation at the point where the last pointer to an object goes away. It runs at about the same speed as ReadMostlyMainPtr and avoids reader‐reader contention and atomic RMWs in the absence of writes.
Member Functions
Name |
Description |
|
Constructors |
Atomically replaces the held pointer. |
|
Atomically replaces the held pointer if it equals the expected one. |
|
Atomically replaces the held pointer if it equals the expected one. |
|
Atomically replaces the held pointer and returns the previous one. |
|
Reports whether operations on this object are lock‐free. |
|
Atomically reads the held pointer. |
|
Atomically replaces the held pointer. |
Template Parameters
Name |
Description |
T |
The pointee type. |
Created with MrDocs