Skip to main content

Module shared_atomic

Module shared_atomic 

Source
Expand description

SharedAtomic<T> - cross-process atomic counter / flag.

Backed by an MMF cell whose payload is interpreted directly as AtomicU8 / AtomicU16 / AtomicU32 / AtomicU64. The atomic ops are cross-process safe on every modern CPU because hardware cache coherence guarantees the atomic semantics across address spaces; the only requirement is that both processes map the same physical page (which the OS guarantees when they open the same MMF file).

Three concrete types:

  • SharedAtomicU32
  • SharedAtomicU64
  • SharedAtomicBool (one byte, but enforced bool semantics)

Type-erased layout: header + payload region the size of the native atomic, aligned naturally.

Structs§

SharedAtomicBool
SharedAtomicU32
SharedAtomicU64

Enums§

SharedAtomicError

Constants§

ATOMIC_MAGIC