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 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 required CAS2.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
S. V. Adve and K. Gharachorloo. Shared memory consistency models: a tutorial. IEEE Computer, 29(12):66–76, Dec. 1996.
J. H. Anderson and M. Moir. Universal constructions for multi-object operations. In Proc. 14th PODC, pp 184–193, Aug. 1995.
J. H. Anderson, S. Ramamurthy, and R. Jain. Implementing wait-free objects on priority-based systems. In Proc. 16th PODC, pp 229–238, Aug. 1997.
D. L. Detlefs, C. H. Flood, A. T. Garthwaite, P. A. Martin, N. N. Shavit, and G. L. Steele Jr. Even better DCAS-based concurrent deques. In Proc. 14th DISC, LNCS 1914, pp 59–73, Oct. 2000.
M. Greenwald. Non-blocking synchronization and system design. PhD thesis, Stanford University, Aug. 1999.
T. L. Harris. A pragmatic implementation of non-blocking linked lists. In Proc. 15th DISC, LNCS 2180, pp 300–314, Oct. 2001.
M. Herlihy. A methodology for implementing highly concurrent data objects. ACM TOPLAS, 15(5):745–770, Nov. 1993.
M. Herlihy, V. Luchangco, and M. Moir The repeat offender problem: a mechanism for supporting dynamic-sized, lock-free data structures. In Proc. 16th DISC, 2002.
G. J. Holzmann. The model checker SPIN. IEEE Transactions on Software Engineering, 23(5):279–295, May 1997.
A. Israeli and L. Rappoport. Disjoint-access-parallel implementations of strong shared memory primitives. In Proc. 13th PODC, pp 151–160, Aug. 1994.
H. Massalin and C. Pu. A lock-free multiprocessor OS kernel. Technical Report CUCS-005-91, Columbia University, Department of Computer Science, June 1991.
J. M. Mellor-Crummey and M. L. Scott. Algorithms for scalable synchronization on shared-memory multiprocessors. ACM TOCS, 9(1):21–65, Feb. 1991.
M. M. Michael. Safe memory reclamation for dynamic lock-free objects using atomic reads and writes. In Proc. 21st PODC, July 2002.
M. Moir. Practical implementations of non-blocking synchronization primitives. In Proc. 16th PODC, pp 219–228, Aug. 1997.
M. Moir. Transparent support for wait-free transactions. In Distributed Algorithms, 11th International Workshop, LNCS 1320, pp 305–319, Sept. 1997.
N. N. Shavit and D. Touitou. Software transactional memory. In Proc. 14th PODC, pp 204–213, Aug. 1995.
J. D. Valois. Lock-free linked lists using compare-and-swap. In Proc. 14th PODC pp 214–222, Aug. 1995.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Harris, T.L., Fraser, K., Pratt, I.A. (2002). A Practical Multi-word Compare-and-Swap Operation. In: Malkhi, D. (eds) Distributed Computing. DISC 2002. Lecture Notes in Computer Science, vol 2508. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36108-1_18
Download citation
DOI: https://doi.org/10.1007/3-540-36108-1_18
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-00073-0
Online ISBN: 978-3-540-36108-4
eBook Packages: Springer Book Archive