将Compare-and-Swap简化为共识第一原语
Reducing Compare-and-Swap to Consensus Number One Primitives
摘要:
一个对象的共识数是可以使用任意数量的对象实例和读写寄存器解决二进制共识的进程的最大数量。Herlihy [6]在他的开创性工作中表明,如果一个对象的共识数为n,那么对于任何非平凡的并发对象或在n个进程中共享的数据结构,都存在一个无等待和可线性化的实现的通用构造。因此,诸如具有无限一致性数和对应指令的比较和交换的同步对象可以被视为“强”。另一方面,诸如具有共识数2的取加和对应的取加指令的同步对象可以被视为“弱”。Ellen等人[2]最近观察到,支持两个弱指令的对象也可以像支持一个强指令的对象一样实现无限的共识数。使用Herlihy的通用构造,这意味着忽略对效率的关注,可以仅使用弱指令来设计任何并发数据结构或算法。然而,有没有可能弱指令的组合真的足够强大,可以有效地替换强指令,如比较和交换,而不会在时间或空间上产生很大的开销?在本文中,我们回答了这个问题,给出了一个O(1)时间等待免费和线性化的实现比较和交换寄存器共享n个进程使用读写寄存器和O(1)寄存器,支持两个同步原语半最大和最大写,每个有共识数1。因此,任何使用读写和比较交换寄存器解决任意同步问题的算法都可以转换为具有相同渐近时间复杂度且仅使用一致性1号指令的算法。
英文摘要:
The consensus number of an object is the maximum number of processes among which binary consensus can be solved using any number of instances of the object and read-write registers. Herlihy [6] showed in his seminal work that if an object has a consensus number of n, then there is a universal construction for a wait-free and linearizable implementation of any non-trivial concurrent object or data structure that is shared among n processes. Thus, a synchronization object such as compare-and-swap with an infinite consensus number and the corresponding instruction can be viewed as "strong". On the other hand, a synchronization object such as fetch-and-add with consensus number two and the corresponding fetch-and-add instruction can be viewed as "weak". Ellen et al. [2] observed recently that an object supporting two weak instructions can also achieve infinite consensus number like an object that supports one strong instruction. Using Herlihy's universal construction, this implies that ignoring concerns about efficiency, one can design any concurrent data structure or algorithm using only weak instructions. However, is it possible that a combination of weak instructions is really powerful enough to efficiently replace a strong instruction, like compare-and-swap, without incurring a large overhead in time or space? In this paper, we answer this question by giving an O(1) time wait-free and linearizable implementation of a compare-and-swap register shared among n processes using read-write registers and O(1) registers that support two synchronization primitives half-max and max-write, each having consensus number one. Thus, any algorithm that solves some arbitrary synchronization problem using read-write and compare-and-swap registers can be transformed into an algorithm that has the same asymptotic time complexity and only uses consensus number one instructions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。