June 2018
Intermediate to advanced
348 pages
8h 45m
English
Operations on atomic types performed with relaxed memory ordering using the tag std::memory_order_relaxed are not synchronization operations. In contrast with other ordering options that are available in the standard library, they do not impose an order among concurrent memory access. The relaxed memory ordering semantics only guarantee that the operations on the same atomic type inside the same thread cannot be reordered, and this guarantee is called modification order consistency. In fact, relaxed ordering only guarantees atomicity and modification order consistency. Therefore, other threads can see these operations in different orders.
Relaxed memory ordering can be used effectively in places where synchronization or ordering ...