根据cache coherence与memory consistency model之间的关系,可以分为两大类:
- Consistency-agnostic coherence:此类缓存一致性是同步实现的,此时,缓存仿佛在内存层级中不存在,对程序和程序员完全透明,内存系统可以被当作是原子的。在此类情况下,memory consistency model通过处理器的微架构实现。
- Consistency-directed coherence:缓存一致性是异步实现的,因此可能会出现过时的数据被读取的情况。此时,缓存一致性协议和处理器一同实现内存模型。这种协议主要出现在异构系统中,如GPU。(SC和TSO都可以实现)
This definition highlights an important distinction between coherence and consistency in the literature: coherence is specified on a per-memory location basis, whereas consistency is specified with respect to all memory locations. A Primer on Memory Consistency and Cache Coherence