A Practical Multi-word Compare-and-Swap Operation
A Practical Multi-word Compare-and-Swap Operation
复制标题
DOI:
10.1007/3-540-36108-1_18
复制
发表时间:
2002-10
期刊:
影响因子:
--
通讯作者:
T. Harris;K. Fraser;I. Pratt
中科院分区:
文献类型:
--
作者:
T. Harris;K. Fraser;I. Pratt
Work on non-blocking data structures has proposed extending processor designs with a compare-and-swap primitive,CAS2, which acts on two arbitrary memory locations. Experience suggested that current operations, typically single-word compare-and-swap (CAS1), are not expressive enough to be used alone in an efficient manner. In this paper we buildCAS2fromCAS1and, in fact, build an arbitrary multi-word compare-and-swap (CASN). Our design requires only the primitives available on contemporary systems, reserves a small and constant amount of space in each word updated (either 0 or 2 bits) and permits nonoverlapping updates to occur concurrently. This provides compelling evidence that current primitives are not only universal in the theoretical sense introduced by Herlihy, but are also universal in their use as foundations for practical algorithms. This provides a straightforward mechanism for deploying many of the interesting non-blocking data structures presented in the literature that have previously requiredCAS2.