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:
SharedAtomicU32SharedAtomicU64SharedAtomicBool(one byte, but enforced bool semantics)
Type-erased layout: header + payload region the size of the native atomic, aligned naturally.