Skip to content

Add section on memory consistency models#19

Merged
jserv merged 1 commit into
mainfrom
memory-model
May 11, 2026
Merged

Add section on memory consistency models#19
jserv merged 1 commit into
mainfrom
memory-model

Conversation

@jserv

@jserv jserv commented May 11, 2026

Copy link
Copy Markdown
Contributor

This introduces a "Memory consistency models" subsection that walks via sequential consistency, total store order, and relaxed/weak ordering using four litmus tests (Message Passing, Store Buffer, IRIW, and Coherence) and three hardware-model figures.

The SC/TSO/relaxed progression, the choice of litmus tests, and the hardware diagrams are adapted from Russ Cox's essay "Hardware Memory Models" (https://research.swtch.com/hwmm); a citation has been added to the Additional Resources appendix. The Lamport SC paper, Sewell et al.'s x86-TSO CACM paper, and the diy/herdtools7 toolchain are also cited.

The existing memory_order_* discussion is renested under a new "C11/C++11 atomics" subsection so the chapter reads model -> API.


Summary by cubic

Added a “Memory consistency models” subsection that explains SC, TSO, and relaxed/weak ordering with four litmus tests and three hardware diagrams. Restructured the chapter so it flows model → API by moving memory_order_* content under a new “C11/C++11 atomics” subsection.

  • New Features

    • Added litmus tests: Message Passing, Store Buffer, IRIW, Coherence.
    • Included figures: hw-seq-cst.pdf, hw-tso.pdf, hw-relaxed.pdf.
    • Cited Lamport SC, x86-TSO (CACM), Russ Cox’s essay, and tools diy and herdtools7.
  • Refactors

    • Moved existing memory_order_* discussion under “C11/C++11 atomics” to emphasize model-first explanations.

Written for commit 46f6a7a. Summary will update on new commits.

This introduces a "Memory consistency models" subsection that walks via
sequential consistency, total store order, and relaxed/weak ordering
using four litmus tests (Message Passing, Store Buffer, IRIW, and
Coherence) and three hardware-model figures.

The SC/TSO/relaxed progression, the choice of litmus tests, and the
hardware diagrams are adapted from Russ Cox's essay
"Hardware Memory Models" (https://research.swtch.com/hwmm); a citation
has been added to the Additional Resources appendix. The Lamport SC
paper, Sewell et al.'s x86-TSO CACM paper, and the diy/herdtools7
toolchain are also cited.

The existing memory_order_* discussion is renested under a new
"C11/C++11 atomics" subsection so the chapter reads model -> API.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@jserv jserv merged commit b81a1c2 into main May 11, 2026
2 checks passed
@jserv jserv deleted the memory-model branch May 11, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant