Skip to content

Further reading

These references offer introductions, practical examples, and deeper treatments of the topics in this primer.

Many examples use C++ or Rust. They are useful for understanding concurrency, but language and library guarantees differ; use the relevant C and CPython contracts when applying them to interpreter code. Likewise, hardware and Linux kernel ordering rules are not substitutes for the C memory model.

Introductions

  • Russ Cox, Memory Models. A high-level introduction to the problems memory models address.
  • Hans Boehm, A Less Formal Explanation of the Proposed C++ Concurrency Memory Model. An approachable explanation of the fundamental concepts behind the C/C++ memory model, written during its development.
  • Mara Bos, Rust Atomics and Locks, chapters 2 (Atomics) and 3 (Memory Ordering). A readable introduction with Rust examples that are useful even if you do not write Rust. Chapter 7 (Understanding the Processor) builds intuition about the hardware layer; it is not a prerequisite for writing correct code.
  • ThreadSanitizer, About Data Races. An explanation of data races and why they matter.

Atomics and memory ordering

  • cppreference, std::memory_order. A reference for C++ memory orders and their ordering guarantees.
  • GCC wiki, Memory model synchronization modes. A reference for GCC's atomic synchronization modes.
  • Compiler Explorer examples of atomic operations. Compare generated assembly for different memory orders. ARM's weaker hardware memory model often requires different instructions where x86/AMD64 does not; for example, relaxed and acquire loads commonly use the same x86 instruction. Identical assembly does not imply identical language-level guarantees.

Talks

Locking and broader parallel programming

Hardware ordering and memory barriers

These are deeper references for understanding processors and low-level ordering. Keep their hardware or kernel context in mind when reading them.


Back to primer ยท Contents and topic index

Markdown source