A Primer on Memory Consistency and Cache Coherence

Mark Hill

出版时间

2012-03-12

ISBN

9781608455645

评分

★★★★★
书籍介绍

Many modern computer systems and most multicore chips (chip multiprocessors) support shared memory in hardware. In a shared memory system, each of the processor cores may read and write to a single shared address space. For a shared memory machine, the memory consistency model defines the architecturally visible behavior of its memory system. Consistency definitions provide rules about loads and stores (or memory reads and writes) and how they act upon memory. As part of supporting a memory consistency model, many machines also provide cache coherence protocols that ensure that multiple cached copies of data are kept up-to-date. The goal of this primer is to provide readers with a basic understanding of consistency and coherence. This understanding includes both the issues that must be solved as well as a variety of solutions. We present both highlevel concepts as well as specific, concrete examples from real-world systems.

精彩摘录
  • "Coherence invariants 1. Single-Writer, Multiple-Read (SWMR) Invariant. For any memory location A, at any given (logical) time, there exists only a single core that may write to A (and can also read it) or some number of cores that may only read A. 2. Data-Value Invariant. The value of the memory loc"
目录
Table of Contents:
Preface
Introduction to Consistency and Coherence
Coherence Basics
Memory Consistency Motivation and Sequential Consistency

显示全部
用户评论
真棒...
好书,memory model和cc细节讲的很清楚,2020年2月出了第二版,添加了consistency-agnostic coherence和部分模型验证内容。
Coherence, consistency, atomicity, causality. 顺便提一下,之前想了半天的 x86 store load 乱序在书里有很好复现的例子。
值得二刷
看了一半,感觉已经失去对底层或硬件层的兴趣
Cache Coherence是硬件提供的功能,所以这部分软件开发者可以当黑盒跳过,这本书重点看3,4,5章即可,这三章是重点讲三种内存模型的内容。
想了解 memory model 就绕不开体系结构,感觉浓缩的比较多,要是有其他书辅助理解就更好了。感觉发现了新大陆,平时说什么 thread safe / atomic,都太笼统了
收藏