SEQUENTIAL CONSISTENCY----SC

SC模型是最直观的memory consistency model;

什么是single core sequential?

  • 真正的执行顺序,和PO的顺序,是相同的;

什么是multi core sequential consistent?

  • the operations of each individual processor (core) appear in this sequence in the order specified by its program
  • (每个单核的执行顺序同PO顺序;)
  • the result of any execution is the same as if the op erations of all processors (cores) were executed in some sequential order
  • (多核之间的指令执行顺序是按照某种sequential order的,其执行结果是可预期的;)

什么是memory order?

 上面描述的这种指令执行的总的顺序,称之为memory order;

什么是SC?

SC这种memory consistency model中,每个core的执行顺序和指令的PO顺序相同;

Under SC, memory order respects each core’s program order. “Respects” means that op1 <p op2 implies op1 <m op2.

<m: memory操作的顺序;

<p: program的顺序; 

SC的实例:

在SC模型下,程序可能的执行顺序:

使用了SC模型后,表 3.1 程序的所有执行都以 r2 作为 NEW 终止。唯一的不确定性—— L1 在加载值 SET 一次之前加载 flag 为 0 的次数——并不重要。

另一个例子:

最后一个不满足SC;

SC模型的规则提取:

  • L(a) and S(a) represent a load and a store, respectively, to address a;
  • Orders <p and <m define program and global memory order;

SC需要满足如下一些规则:

  • 所有load和store, 其操作内存的顺序,必须满足po, 不管地址是否相同;
  • 访问相同地址的load, 拿到的数据,一定是之前该地址的store所写入的数据; 
    • Value of L(a) = Value of MAX <m {S(a) | S(a) <m L(a)}, where MAX <m denotes “latest in memory order.”
    • RMW这类原子操作,要求load/store要紧挨着,中间不允许被其他内存操作所插入;

   将上述的规则,转变成表格:

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值