flâneur — a map of the web's best reading

C++11 Memory Model

people.cs.pitt.edu · 2,020 words · saved by 1 readers

A memory model, a.k.a memory consistency model, is a specification of the allowed behavior of multithreaded programs executing with shared memory [1]. The most basic model is sequential consistency (SC), where all insructions from all threads (appear to) form a total order that is consistent with the program order on each thread [2]. One of the most important features of C++11 is to provide a multithreading-aware memory model, which enables write multithreaded programs without relying on platform-specific extensions. [1] Memory consistency primer [2] Flight data recorder SC means that all threads agree on the order in which memory operations occured, and that order is consistent with the oder of operations in the program source code. Some programming languages offer SC in multiprocessor environment. In C++11, you can declare all shared variables as C++11 atomic types with default memory ordering constraints. In Java, you can mark all shared variables as volatile [1] [2]. The compiler i

C++11 Memory Model Table of Contents Sequential consistency Concurrency needs sync Memory ordering is crucial Ordering techniques Object layout C++11 techniques C++11 Memory Model A memory model, a.k.a memory consistency model , is a specification of the allowed behavior of multithreaded programs executing with shared memory [ 1 ]. The most basic model is sequential consistency (SC), where all insructions from all threads (appear to) form a total order that is consistent with the program order on each thread [ 2 ]. One of the most important features of C++11 is to provide a multithreading-awar

Explore this link on the map →

saved by

related reading