Atomics

In this lesson, we will discuss atomics and the different kinds of atomic operations.

We'll cover the following...

Atomics are the base of the C++ memory model. By default, the strong version of the memory model is applied to atomics. Therefore, it is important to understand the features of the strong memory model and their relation to atomics.

Atomic operations on atomics define the synchronization and ordering constraints.

Kinds of Atomic Operations

There are three different kinds of atomic operations:

  • Read operation: memory_order_acquire and memory_order_consume
  • Write operation: memory_order_release
  • Read-modify-write operation: memory_order_acq_rel
...