How to share a data structure: A fast timing-based solution∗

We consider the problem of transforming a given sequential implementation of a data structure into a wait-free concurrent implementation. Given the code for different operations of a data structure that is designed to work under the assumption that only a single process accesses it, we want to construct an implementation that works correctly in a concurrent environment where it may be accessed by many processes. We assume a shared memory model with atomic registers. It is well known that, in asynchronous systems, using atomic read/write registers only, it is impossible to construct concurrent implementations of even very simple objects such as test-and-set bits. We show that the knowledge about relative speeds of processes can be used for such implementations. We assume that there is a known upper bound on the time taken by the slowest process to execute a statement involving an access to the shared memory. This timing assumption is very powerful and enables us to construct fast wait-free implementations of data structures such as queues, stacks and synchronization primitives such as test-and-set, compare-and-swap, fetch-and-add, etc. Our transformation works only when the given sequential implementation is bounded, that is, there is a known upper bound on the number of steps required to complete any of the operations it supports. In the absence of contention, transformation guarantees that there is only a small overhead in the cost of executing the concurrent operations over the sequential ones, namely, only a constant number of accesses to the shared memory. ∗A preliminary version of this work has appeared as [AT93]. †Bell Laboratories, and Department of Electrical Engineering and Computer Science, University of California, Berkeley, CA 94720. alur@eecs.berkeley.edu. ‡The Open University, 16 Klausner street, P.O. Box 39328, Tel-Aviv 61392, Israel, and AT&T Labs. gadi@tavor.openu.ac.il.

[1]  Carla Schlatter Ellis,et al.  Concurrent Search and Insertion in AVL Trees , 1980, IEEE Transactions on Computers.

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

[3]  Yehuda Afek,et al.  Wait-free made fast , 1995, STOC '95.

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

[5]  Yehoshua Sagiv,et al.  Concurrent operations on B-trees with overtaking , 1985, J. Comput. Syst. Sci..

[6]  Mark Moir,et al.  Universal Constructions for Large Objects , 1995, IEEE Trans. Parallel Distributed Syst..

[7]  Rudolf Bayer,et al.  Concurrency of operations on B-trees , 1994, Acta Informatica.

[8]  John D. Valois Lock-free linked lists using compare-and-swap , 1995, PODC '95.

[9]  Rajeev Alur,et al.  How to share an object: A fast timing-based solution , 1993, Proceedings of 1993 5th IEEE Symposium on Parallel and Distributed Processing.

[10]  Carla Schlatter Ellis,et al.  Distributed data structures: A case study , 1985, IEEE Transactions on Computers.

[11]  Rajeev Alur,et al.  Time-adaptive algorithms for synchronization , 1994, STOC '94.

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

[13]  Dennis Shasha,et al.  Locking without blocking: making lock based concurrent data structure algorithms nonblocking , 1992, PODS '92.

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

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

[16]  Serge A. Plotkin Sticky bits and universality of consensus , 1989, PODC '89.

[17]  Edsger W. Dijkstra,et al.  Solution of a problem in concurrent programming control , 1965, CACM.

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

[19]  Edsger W. Dijkstra,et al.  Solution of a problem in concurrent programming control , 1965, CACM.

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

[21]  Leslie Lamport,et al.  Specifying Concurrent Program Modules , 1983, TOPL.

[22]  Rajeev Alur,et al.  Fast timing-based algorithms , 1996, Distributed Computing.

[23]  Michel Raynal,et al.  Algorithms for mutual exclusion , 1986 .

[24]  S. B. Yao,et al.  Efficient locking for concurrent operations on B-trees , 1981, TODS.

[25]  J. Burns Mutual exclusion with linear waiting using binary shared variables , 1978, SIGA.

[26]  G. Taubenfeld,et al.  Results about fast mutual exclusion , 1992, [1992] Proceedings Real-Time Systems Symposium.

[27]  Maged M. Michael,et al.  Simple, fast, and practical non-blocking and blocking concurrent queue algorithms , 1996, PODC '96.

[28]  Michael Merritt,et al.  Speeding Lamport's Fast Mutual Exclusion Algorithm , 1993, Inf. Process. Lett..

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

[30]  Richard J. Anderson,et al.  Wait-free parallel algorithms for the union-find problem , 1991, STOC '91.

[31]  Manhoi Choy,et al.  Adaptive solutions to the mutual exclusion problem , 1993, PODC '93.

[32]  Mark Moir,et al.  Using k-exclusion to implement resilient, scalable shared objects (extended abstract) , 1994, PODC '94.

[33]  Dennis Shasha,et al.  Concurrent set manipulation without locking , 1988, PODS '88.

[34]  Rajeev Alur,et al.  Time-Adaptive Algorithms for Synchronization , 1997, SIAM J. Comput..

[35]  Yehoshua Sagiv Concurrent Operations on B*-Trees with Overtaking , 1986, J. Comput. Syst. Sci..

[36]  Leslie Lamport,et al.  A fast mutual exclusion algorithm , 1987, TOCS.

[37]  N. Lynch,et al.  Timing-based mutual exclusion , 1992, [1992] Proceedings Real-Time Systems Symposium.

[38]  Amos Israeli,et al.  Efficient Wait-Free Implementation of a Concurrent Priority Queue , 1993, WDAG.

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

[40]  Maurice Herlihy,et al.  Axioms for concurrent objects , 1987, POPL '87.

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