Search⌘ K

Relaxed Semantic

Learn about the relaxed semantic memory model in modern C++ concurrency. Understand how atomic operations maintain modification order consistency within a thread, how synchronization points like thread joins ensure well-defined behavior, and why these principles matter for atomic counters and reference counting. This lesson helps you grasp how relaxed semantics enable wait-free, lock-free operations while requiring careful coordination between threads.

The relaxed semantic is the other end of the spectrum. It’s the weakest of all memory models and only guarantees that the operations on the same atomic data type in the same thread won’t be reordered. That guarantee is called modification order consistency. Other threads can see these operations in a different order.

No Synchronization & Ordering constraints?

This is quite easy; if there are no rules, we cannot violate them. But that is too easy, as the program should have well-defined behavior. In particular, this means that data races are not allowed. To guarantee this you typically use synchronization and ordering constraints of stronger ...