Even Better DCAS-Based Concurrent Deques

The computer industry is examining the use of strong synchronization operations such as double compare-and-swap (DCAS) as a means of supporting non-blocking synchronization on tomorrow's multiprocessor machines. However, before such a primitive will be incorporated into hardware design, its utility needs to be proven by developing a body of effective non-blocking data structures using DCAS.In a previous paper, we presented two linearizable non-blocking implementations of concurrent deques (double-ended queues) using the DCAS operation. These improved on previous algorithms by nearly always allowing unimpeded concurrent access to both ends of the deque while correctly handling the difficult boundary cases when the deque is empty or full. A remaining open question was whether, using DCAS, one can design a non-blocking implementation of concurrent deques that allows dynamic memory allocation but also uses only a single DCAS per push or pop in the best case.This paper answers that question in the affirmative. We present a new non-blocking implementation of concurrent deques using the DCAS operation. This algorithm provides the benefits of our previous techniques while overcoming drawbacks. Like our previous approaches, this implementation relies on automatic storage reclamation to ensure that a storage node is not reclaimed and reused until it can be proved that the node is not reachable from any thread of control. This algorithm uses a linked-list representation with dynamic node allocation and therefore does not impose a fixed maximum capacity on the deque. It does not require the use of a "spare bit" in pointers. In the best case (no interference), it requires only one DCAS per push and one DCAS per pop. We also sketch a proof of correctness.

[1]  Maged M. Michael,et al.  Correction of a Memory Management Method for Lock-Free Data Structures , 1995 .

[2]  David R. Cheriton,et al.  The synergy between non-blocking synchronization and operating system structure , 1996, OSDI '96.

[3]  Hagit Attiya,et al.  Atomic Snapshots in O(n log n) Operations , 1998, SIAM J. Comput..

[4]  Maurice Herlihy,et al.  Transactional Memory: Architectural Support For Lock-free Data Structures , 1993, Proceedings of the 20th Annual International Symposium on Computer Architecture.

[5]  Donald E. Knuth,et al.  The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition , 1997 .

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

[7]  Maurice Herlihy,et al.  A methodology for implementing highly concurrent data structures , 1990, PPOPP '90.

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

[9]  Donald Ervin Knuth,et al.  The Art of Computer Programming, 2nd Ed. (Addison-Wesley Series in Computer Science and Information , 1978 .

[10]  Nir Shavit,et al.  DCAS-based concurrent deques , 2000, SPAA '00.

[11]  David R. Cheriton,et al.  Non-blocking synchronization and system design , 1999 .

[12]  Donald E. Knuth The art of computer programming: fundamental algorithms , 1969 .

[13]  Maurice Herlihy,et al.  A methodology for implementing highly concurrent data objects , 1993, TOPL.

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

[15]  Brian N. Bershad,et al.  Practical considerations for non-blocking concurrent objects , 1993, [1993] Proceedings. The 13th International Conference on Distributed Computing Systems.

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

[17]  Nancy A. Lynch,et al.  Are wait-free algorithms fast? , 1994, JACM.

[18]  Calton Pu,et al.  A Lock-Free Multiprocessor OS Kernel , 1992, OPSR.

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

[20]  Greg Barnes,et al.  A method for implementing lock-free shared-data structures , 1993, SPAA '93.

[21]  C. Greg Plaxton,et al.  Thread Scheduling for Multiprogrammed Multiprocessors , 1998, SPAA '98.

[22]  Corporate Motorola,et al.  MC 68000 16-Bit Microprocessor User's Manual , 1982 .

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