Lock‐free read slot for hardware‐atomic T.

Synopsis

Declared in <folly/ConcurrentBSkipList‐detail.h>

template<typename T>
struct AtomicSlot;

Description

The atomic load instruction IS the bracket: a writer's store either fully precedes or fully follows the reader's load and never tears. Readers need no surrounding protocol.

Wraps folly::relaxed_atomic<T>; synthesized copy/move ops let std::array element‐assignment compile in splitKeys/moveChildren (raw std::atomic isn't copyable).

Alignment inherits from std::atomic<T> and is STRICTER than alignof(T) when the lock‐free instruction is wider than T's natural alignment (e.g. 16‐byte cmpxchg16b on an 8‐byte‐aligned 16‐byte struct). Do NOT replace this wrapper with std::atomic_ref<T> over raw T storage: atomic_ref surrenders that alignment guarantee back to the caller AND regressed children_ traversal on 16B‐key benchmarks (misaligned loads).

Member Functions

Name

Description

AtomicSlot [constructor]

Constructors

~AtomicSlot [destructor]

Destroys the slot.

operator=

Assignment operators

operator T

Loads the current value from this slot.

Data Members

Name

Description

val_

The underlying relaxed atomic storage.

Template Parameters

Name

Description

T

The stored hardware‐atomic value type.

Created with MrDocs