Add section on memory consistency models#19
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
hw-seq-cst.pdf,hw-tso.pdf,hw-relaxed.pdf.diyandherdtools7.Refactors
memory_order_*discussion under “C11/C++11 atomics” to emphasize model-first explanations.Written for commit 46f6a7a. Summary will update on new commits.