arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1911.09671cs.DC
收藏

LL/SC和原子复制:仅使用指针宽度CAS的恒定时间、空间效率实现

LL/SC and Atomic Copy: Constant Time, Space Efficient Implementations using only pointer-width CAS

Guy E. Blelloch, Yuanhao Wei

摘要:

在设计并发算法时,加载链接/存储条件(LL/SC)通常是理想的原语,因为与比较和交换(CAS)不同,LL/SC不受ABA问题的影响。然而,LL/SC的完整语义不被任何现代机器支持,因此已经有大量的工作在使用比较和交换(CAS)来模拟LL/SC,CAS是一种享有广泛硬件支持的同步原语。到目前为止,所有的算法都是常数时间的,要么使用无界序列号(因此基本对象的大小是无界的),要么需要$Ω(MP)$空间用于$M$ LL/SC对象(其中$P$是进程的数量)。我们提出了一个恒定的时间实现$M$ LL/SC对象使用$Θ(M+kP^2)$空间,其中$k$是重叠的LL/SC操作每个进程的最大数量(通常是一个常数),只需要指针大小的CAS对象。我们的实现也可以用来实现$L$ -字$LL/SC$对象在$Θ(L)$时间($LL$和$SC$)和$Θ((M+kP^2)L)$空间。为了实现这些边界,我们首先实现一个名为Single-Writer Copy的新原语,它将指针指向一个字大小的内存位置,并将其内容原子地复制到另一个对象中。限制是一次只允许一个进程写入/复制到目标对象中。我们相信这个原语在设计其他并发算法时也是非常有用的。

英文摘要:

When designing concurrent algorithms, Load-Link/Store-Conditional (LL/SC) is often the ideal primitive to have because unlike Compare and Swap (CAS), LL/SC is immune to the ABA problem. However, the full semantics of LL/SC are not supported by any modern machine, so there has been a significant amount of work on simulations of LL/SC using Compare and Swap (CAS), a synchronization primitive that enjoys widespread hardware support. All of the algorithms so far that are constant time either use unbounded sequence numbers (and thus base objects of unbounded size), or require $Ω(MP)$ space for $M$ LL/SC object (where $P$ is the number of processes). We present a constant time implementation of $M$ LL/SC objects using $Θ(M+kP^2)$ space, where $k$ is the maximum number of overlapping LL/SC operations per process (usually a constant), and requiring only pointer-sized CAS objects. Our implementation can also be used to implement $L$-word $LL/SC$ objects in $Θ(L)$ time (for both $LL$ and $SC$) and $Θ((M+kP^2)L)$ space. To achieve these bounds, we begin by implementing a new primitive called Single-Writer Copy which takes a pointer to a word sized memory location and atomically copies its contents into another object. The restriction is that only one process is allowed to write/copy into the destination object at a time. We believe this primitive will be very useful in designing other concurrent algorithms as well.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑