See also: 顺序一致性。
内存顺序一致性(sequential consistency)
Links to this note
Memory coherence vs consistency
Coherence deals with maintaining a global order in which writes to a single location or single variable are seen by all processors. Consistency deals with the ordering of operations to multiple locations with respect to all processors. Memory coherence: a memory system is coherent if any read of a data item returns the most recently written value of that data item (what values can be returned by a read)....
内存一致性模型
tags: 一致性,Memory Model 当执行给定程序时,硬件和编译器之间的契约,对编译后后的代码对存储在内存中的数据更改的可见性和一致性。 这种契约称为「内存一致性模型(Memeory Consistency Model)」或仅仅是「内存模型(Memory Model)」。 最初目标是定义程序员编写汇编代码时硬件提供的保证,后来用来定义高级编程语言(如 C++ 或 Java)对该语言编写代码的程序员提供的保证。 例如下面变量都初始为 0 的情况下,线程 1 和 2 都运行在自己专用的处理器上,都运行到完成,这个程序能打印 0 吗? // Thread 1 // Thread 2 x = 1; while(done == 0) { /* loop */ } done = 1; print(x); Memory coherence vs consistency 内存一致性(coherence) 内存顺序一致性(sequential consistency) 硬件 顺序一致性 x86 总存储有序(x86-TSO) ARM/POWER Relaxed Memory Model 弱有序和无数据竞争(DRF) 编程语言内存模型