CHI协议之Atomicity

Atomicity 是用来描述系统中的memory access 的特性的一个术语;
================Coherent order====================
英文描述:
Data accesses from a set of observers to a byte in memory are coherent if accesses to that byte in memory by the members of that set of observers are consistent with there being a single total order of all writes to that byte in memory by all members of the set of observers. This single total orderof all to writes to that memory location is the coherence order for that byte in memory
意思为,

□ 当一个系统中有多个PE,这些 PE 都可以发送访问 memory 中某个byte 的读写访问:
当这些 PE 有多个都发送读写时,每个PE 都要看到具体的写入顺序,例如 PEO 先写入,然后是 PE1,然后是 PE3,然后是 PE2;


♦ 这种每个 PE 观察的顺序和硬件实际的执行的顺序保持一致的特性,称之为 single total order;
♦ 这种对于某段地址,每个PE 都满足 single total order 的特性,称之为 coherent order; 


================Single-copy atomicity===================
含义:描述单核系统的 atomicity,该内存访问操作是否是原子的,是否是可以被打断的。
           读写满足如下条件时,认为是 single-copy atoricity;
---> 当两笔写有 overlap,那么此时这两笔写,是分别按照一个整体来插入 coherent order 的,即本次store操作中所涉及的每一个bit,这此bits 是一个不可分隔的整体,插入到Coherence order 操作序列中。
---> 读和写之间,如果有地址重叠的话,同样当读返回数据的时候,这些数据要么是写之前的数据,要么是写之后的数据,不会出现其他的一个状态;

===============Multi-copy atomicity==================
为什么不能继续用 Single-copy atomicity 的原因:
--> 用 Single-copy atomicity 来描述一次内存访问的原子性是不够的,因为即便是在执行该内存访问指令的 CPU CORE 上是 Single-copy atomicity 的,也只不过说明该指令不会被本CPU CORE 的异常或者中断之类的异步事件打断,它并不能阻止其他 CPU core 上的内存访问操作对同一地址上的memory location 进行操作;


适用于多核系统其定义如下:
In a multiprocessing system, writes to a memory location are multi-copy atomic if the following conditions are both true:

1. All writes to the same location are serialized, meaning they are observed in the same order by
all observers, although some observers might not observe all of the writes.
2. A read of a location does not return the value of a write until all observers observe that write..
即:
系统中,所有 PE 对于同一个地址的写操作,其处理流程串行的,那么对于所有的observer(PE)而言,每个人看到的写顺序是相同的:
如果此时有人发送一个读操作,HN收到之后,在之前的所有的写完成之前 (所有人都看到写完成了), 是不会返回数据的;

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值