A thread-aware memory model defines how memory operations behave across threads and provides the guarantees that make C++ concurrency facilities reliable. Its precise rules matter most when synchronizing with low-level atomic operations; mutex-protected data and standard signaling facilities often let programmers avoid reasoning about those details. section 5.0 section 1.3.2
The model has two aspects:
- Structural aspects concern how objects and memory locations are laid out. section 5.1
- Concurrency aspects define how operations can synchronize between threads, including through atomic types and operations. section 5.0
C++98 did not formally define a memory model, so multithreaded programs relied on compiler-specific extensions. C++11 established a thread-aware model alongside standard-library support for managing threads, protecting shared data, and synchronizing operations. section 1.3.1 section 1.3.2
