跳转到内容

Load-link/store-conditional

维基百科,自由的百科全书

这是本页的一个历史版本,由CamLine留言 | 贡献2017年11月22日 (三) 05:49 建立内容为“'''load-link'''与'''store-conditional''' ('''LL/SC''')是一对CPU指令用于并发同步访问内存。Load-link…”的新页面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

load-linkstore-conditional (LL/SC)是一对CPU指令用于并发同步访问内存。Load-link返回内存位置处的当前值,随后的store-conditional在该内存位置处保存新值如果从load-link后没有被修改。这被用于实现无锁算法英语Non-blocking_algorithmread-modify-write原子操作。

LL/SC与compare-and-swap在理论上是等价的。[1]

历史

LL/SC最初是Jensen, Hagensen, Broughton在勞倫斯利佛摩國家實驗室S-1 AAP multiprocessor而设计。

实现

LL/SC指令被下述架构支持:

LL/SC的硬件实现典型地不允许嵌套LL/SC对。[2] 嵌套的LL/SC机制用于提供MCAS原语(多字Compare-And-Swap,字可以是分布的)。[3] 2013年Trevor Brown, Faith Ellen, Eric Ruppert软件实现了多地址LL/SC扩展。[4]这被用来优化二叉搜索树。[5]

参见

参考文献

  1. ^ Anderson, James H.; Moir, Mark. Universal constructions for multi-object operations. PODC '95 Proceedings of the fourteenth annual ACM symposium on Principles of distributed computing. ACM. 1995: 184–193. ISBN 0-89791-710-3. doi:10.1145/224964.224985.  See their Table 1, Figures 1 & 2 and Section 2 in particular.
  2. ^ Larus, James R.; Rajwar, Ravi. Transactional Memory. Morgan & Claypool. 2007: 55. ISBN 978-1-59829-124-7. 
  3. ^ Fraser, Keir. Practical lock-freedom (PDF) (技术报告). University of Cambridge Computer Laboratory: 20. February 2004. UCAM-CL-TR-579. 
  4. ^ Brown, Trevor; Ellen, Faith; Ruppert, Eric. Pragmatic primitives for non-blocking data structures (PDF). PODC '13 Proceedings of the 2013 ACM symposium on Principles of distributed computing. ACM. 2013: 13–22. ISBN 978-1-4503-2065-8. doi:10.1145/2484239.2484273.  See also slides
  5. ^ Brown, Trevor; Ellen, Faith; Ruppert, Eric. A general technique for non-blocking trees (PDF). PPoPP '14 ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. ACM. 2014: 329–342. ISBN 978-1-4503-2656-8. doi:10.1145/2555243.2555267.