the memory ordering plain shared state needs on weakly ordered CPUs, in user mode and the kernel alike
More...
the memory ordering plain shared state needs on weakly ordered CPUs, in user mode and the kernel alike
State shared byte for byte across threads and the app/kernel boundary stays plain volatile - a ring's tx/rx cursors, a device's stream slots, a pipe's ticking flag - since std::atomic<> would change its layout. release() orders every store before it ahead of a store after it, so a writer publishes a pointer or cursor after the data it names; acquire() orders every load after it behind a load before it, so a reader that took the pointer or cursor sees that data. The object brackets a handshake: acquire on construction, release on destruction, the publishing store past its scope.