At this point we should formally discuss
memory
coherence and
memory consistency, terms that speak to the
ordering behavior of operations on the mem-ory system. We illustrate their defi nitions within the scope of the race condition example and then discuss them from the perspective of their use in modern multiprocessor systems design.
Memory Coherence(一致性):
The principle of memory coherence indicates
that the memory system
behaves rationally. (理性的,有条理的)
For instance, a value written does not disappear (fail to be read at a later point) unless that value is explicitly overwritten.
Write data cannot be buffered indefinitely; any write data must eventually become visible to subsequent reads unless overwritten. Finally, the system must pick an order. If it is decided
that write X comes before write Y, then at a later point, the system may not act as if Y came before X.
Memory Consistency(前后一致,连贯性)
Whereas coherence
defines rational behavior, the consistency model indicates how long and in what ways the system is allowed to behave irrationally with respect to a given set of references. A memory-consistency model indicates how the memory system inter-leaves read and write accesses, whether they are to the same memory location or not. If two refer-ences refer to the same address, their ordering is obviously important. On the other hand, if two references refer to two different addresses, there can be no data dependencies between the two, and it should, in theory, be possible to reorder them as one sees fi t. This is how modern DRAM memory controllers operate, for instance. How-ever, as the example in Figure 4.6 shows, though a data dependence may not exist between two variables, a causal dependence may nonethe-less exist, and thus it may or may not be safe to reorder the accesses. Therefore, it makes sense to defi ne allowable orderings of references to differ-ent addresses. In the race condition example, depending on ne’s
consistency model, the simple code fragment。
存储一致性和存储一致 ,暂时希望用这样的词汇来表述着两个概念。
存储一致性:表示着,在行为抽象上需要表现出来的一致性的特点和需要满足的规则要求,这个是一致性想要表达的。
存储一致:表示着,在行为抽象为指导的前提下,我们使用的实现这种“性质”的行为,使用这些行为约束而构建出的memory 模型。