This pull request aims to enhance the comprehensiveness of the “Memory orderings” section of this book. Currently, the section primarily covers memory orders defined in C11/C++11 but lacks discussion on hardware assumptions regarding memory consistency. Thus I made the following changes:
Reorganization
Moved the content originally under “Memory orderings” related to C11/C++11 atomics to a dedicated subsection titled “C11/C++ atomics” within the “Memory orderings” section.
Addition
Introduced a new subsection titled “Memory consistency models”
Detailed descriptions of sequential consistency, x86 total store order, and ARM’s relaxed memory order.
Included schematic diagrams illustrating hardware architectures and litmus tests to aid readers’ comprehension.
This pull request aims to enhance the comprehensiveness of the “Memory orderings” section of this book. Currently, the section primarily covers memory orders defined in C11/C++11 but lacks discussion on hardware assumptions regarding memory consistency. Thus I made the following changes: