A Practical Multi-word Compare-and-Swap Operation

  • Authors:
  • Timothy L. Harris;Keir Fraser;Ian A. Pratt

  • Affiliations:
  • -;-;-

  • Venue:
  • DISC '02 Proceedings of the 16th International Conference on Distributed Computing
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 build CAS2 from CAS1 and, in fact, build an arbitrary multiword 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 non-overlapping 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 required CAS2.