CppMem: Atomics with an Acquire-Release Semantic
The synchronization in the acquire-release semantic takes place between atomic operations on the same atomic. This is in contrast to the sequential consistency where we have synchronization between threads. Due to this fact, the acquire-release semantic is more lightweight and, therefore, faster.
Here is the program with acquire-release semantic: