Types of Synchronization & Ordering Constraints
There are, roughly speaking, three different types of synchronization and ordering constraints in C++:
- Sequential consistency:
Modification Order Consistency
While the sequential consistency establishes a global order between threads, the acquire-release semantic establishes an ordering between read and write operations on the same atomic variable with different threads. The relaxed semantic only guarantees that operations on one specific data type in the same thread cannot be reordered. This guarantee is called modification order consistency, but other threads can see this operation in a different order.
The different memory models and their effects on atomic and non-atomic operations make the C++ memory model an interesting and challenging topic. In the next lessons, let us discuss the synchronization and ordering constraints of the sequential consistency, the acquire-release semantic, and the relaxed semantics.