Wait-Free Multi-Word Compare-and-Swap Using Greedy Helping and Grabbing

We present a new algorithm for implementing a multi-word compare-and-swap functionality supporting the Read and CASN operations. The algorithm is wait-free under reasonable assumptions on execution history and benefits from new techniques to resolve conflicts between operations by using greedy helping and grabbing. Although the deterministic scheme for enabling grabbing somewhat sacrifices fairness, the effects are insignificant in practice. Moreover, unlike most of the previous results, the CASN operation does not require the list of addresses to be sorted before the operation is invoked, and the Read operation can read the current value without applying helping when the word to be read is within an ongoing transaction. Experiments using micro-benchmarks varying important parameters in three dimensions have been performed on two multiprocessor platforms. The results show similar performance as the lock-free algorithm by Harris et al. for most scenarios, and significantly better performance on scenarios with very high contention. This is altogether extraordinary good performance considering that the new algorithm is wait-free.

[1]  Maged M. Michael Practical Lock-Free and Wait-Free LL/SC/VL Implementations Using 64-Bit CAS , 2004, DISC.

[2]  Mark Moir,et al.  Transparent Support for Wait-Free Transactions , 1997, WDAG.

[3]  Mark Moir,et al.  Universal constructions for multi-object operations , 1995, PODC '95.

[4]  Håkan Sundell Wait-free reference counting and memory management , 2005, 19th IEEE International Parallel and Distributed Processing Symposium.

[5]  Philippas Tsigas,et al.  NOBLE: non-blocking programming support via lock-free shared abstract data types , 2009, CARN.

[6]  Philippas Tsigas,et al.  Reactive multiword synchronization for multiprocessors , 2003, 2003 12th International Conference on Parallel Architectures and Compilation Techniques.

[7]  Prasad Jayanti A Complete and Constant Time Wait-Free Implementation of CAS from LL/SC and Vice Versa , 1998, DISC.

[8]  Ragunathan Rajkumar,et al.  Synchronization in Real-Time Systems: A Priority Inheritance Approach , 1991 .

[9]  Mark Moir Practical implementations of non-blocking synchronization primitives , 1997, PODC '97.

[10]  Maurice Herlihy,et al.  Wait-free synchronization , 1991, TOPL.

[11]  Keir Fraser,et al.  A Practical Multi-word Compare-and-Swap Operation , 2002, DISC.

[12]  Amos Israeli,et al.  Disjoint-access-parallel implementations of strong shared memory primitives , 1994, PODC '94.

[13]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[14]  John David Valois Lock-free data structures , 1996 .

[15]  Yehuda Afek,et al.  Disentangling multi-object operations (extended abstract) , 1997, PODC '97.

[16]  Hagit Attiya,et al.  Improved implementations of binary universal operations , 2001, JACM.

[17]  Ragunathan Rajkumar,et al.  Synchronization in Real-Time Systems , 1991 .

[18]  Gadi Taubenfeld,et al.  Disentangling Multi-object Operations , 1997 .

[19]  Maurice Herlihy,et al.  Linearizability: a correctness condition for concurrent objects , 1990, TOPL.

[20]  Hagit Attiya,et al.  Universal operations: unary versus binary , 1996, PODC '96.