Synchronization and Ordering

In this lesson, we will learn about different memory models in C++ that relate to synchronization and ordering.

You cannot configure the atomicity of an atomic data type, but you can accurately adjust the synchronization and ordering constraints of atomic operations. This is a possibility unique to C++, and it is not possible in C#'s or Java’s memory model.

There are six variations of the memory model in C++. So, what are the characteristics of these model variations?

The six variants of the C++ memory model

We already know that C++ has six variants of the memory models. The default for atomic operations is std::memory_order_seq_cst. This expression stands for sequential consistency. Additionally, you can explicitly specify one of the other five variants. So, what does this technique of C++ have to offer?

Get hands-on with 1200+ tech skills courses.