Distributed Computing

, Volume 18, Issue 1, pp 21–42 | Cite as

Lock-free dynamic hash tables with open addressing

Article

Abstract.

We present an efficient lock-free algorithm for parallel accessible hash tables with open addressing, which promises more robust performance and reliability than conventional lock-based implementations. "Lock-free" means that it is guaranteed that always at least one process completes its operation within a bounded number of steps. For a single processor architecture our solution is as efficient as sequential hash tables. On a multiprocessor architecture this is also the case when all processors have comparable speeds. The algorithm allows processors that have widely different speeds or come to a halt. It can easily be implemented using C-like languages and requires on average only constant time for insertion, deletion or accessing of elements. The algorithm allows the hash tables to grow and shrink when needed.

Lock-free algorithms are hard to design correctly, even when apparently straightforward. Ensuring the correctness of the design at the earliest possible stage is a major challenge in any responsible system development. In view of the complexity of the algorithm, we turned to the interactive theorem prover PVS for mechanical support. We employ standard deductive verification techniques to prove around 200 invariance properties of our algorithm, and describe how this is achieved with the theorem prover PVS.

CR Subject Classification (1991): D.1 Programming techniques

AMS Subject Classification (1991): 68Q22 Distributed algorithms, 68P20 Information storage and retrieval

Keywords:

Hash tables Distributed algorithms Lock-free Wait-free 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Anderson JH, Ramamurthy S, Jeffay K: Real-time computing with lock-free shared objects. ACM Trans Comput Syst 15(2):134-165 (1997)Google Scholar
  2. 2.
    Attiya H, Bar-Noy A, Dolev D, Peleg D, Reischuk R: Renaming in an asynchronous environment. J ACM 37:524-548 (1990)CrossRefMATHMathSciNetGoogle Scholar
  3. 3.
    Bar-Noy A, Dolev D: Shared-memory vs. message-passing in an asynchronous distributed environment. In: Proc. 8th ACM Symp. on principles of distributed computing, 1989, pp 307-318Google Scholar
  4. 4.
    Barnes G: A method for implementing lock-free shared-data structures. In: Proceedings of the fifth annual ACM symposium on Parallel algorithms and architectures. ACM Press, 1993, pp 261-270Google Scholar
  5. 5.
    Cassez F, Jard C, Rozoy B, Dermot M: Modeling and verification of parallel processes (2000) 4th Summer School, MOVEP 2000, Nantes, FranceGoogle Scholar
  6. 6.
    Gao H, Groote JF, Hesselink WH: PVS verification. !http://www.cs.rug.nl/~wim/mechver! !hashtable! (2003)Google Scholar
  7. 7.
    Groote JF, Hesselink WH, Mauw S, Vermeulen R: An algorithm for the asynchronous write-all problem based on process collision. Distr Comput 14:75-81 (2001)Google Scholar
  8. 8.
    Harbison SP: Modula-3. Prentice Hall, New Yersey 1992Google Scholar
  9. 9.
    Herlihy M: Wait-free synchronization. ACM Trans Program Lang Syst 13:124-149 (1991)CrossRefGoogle Scholar
  10. 10.
    Herlihy M: A methodology for implementing highly concurrent data objects. ACM Trans Program Lang Syst 15:745-770 (1993)CrossRefGoogle Scholar
  11. 11.
    Herlihy M, Wing J: Linearizability: a correctness condition for concurrent objects. ACM Trans Program Lang Syst 12:463-492 (1990)CrossRefGoogle Scholar
  12. 12.
    Herlihy MP, Moss JEB: Lock-free garbage collection for multiprocessors. IEEE Transactions on Parallel and Distributed Systems 3:304-311 (1992)CrossRefGoogle Scholar
  13. 13.
    Hesselink WH: Wait-free linearization with a mechanical proof. Distr Comput 9:21-36 (1995)Google Scholar
  14. 14.
    Hesselink WH: Bounded delay for a free address. Acta Inf 33:233-254 (1996)MATHMathSciNetGoogle Scholar
  15. 15.
    Hesselink WH, Groote JF: Wait-free concurrent memory management by Create, and Read until Deletion (CaRuD). Distr Comput 14:31-39 (2001)Google Scholar
  16. 16.
    Kanellakis PC, Shvartsman AA: Fault-tolerant parallel computation. Kluwer Academic Publishers, Dordrecht 1997Google Scholar
  17. 17.
    Knuth DE: The Art of Computer Programming. Part 3, Sorting and searching. Addison-Wesley 1973Google Scholar
  18. 18.
    LaMarca A: A performance evaluation of lock-free synchronization protocols. In: Proceedings of the thirteenth annual ACM symposium on Principles of distributed computing. ACM Press 1994, pp 130-140Google Scholar
  19. 19.
    Lamport L: The temporal logic of actions. ACM Trans Program Lang Syst 16:872-923 (1994)CrossRefGoogle Scholar
  20. 20.
    Lynch NA: Distributed Algorithms. Morgan Kaufman, San Francisco 1996Google Scholar
  21. 21.
    Manna Z, Pnueli A: The Temporal Logic of Reactive and Concurrent Systems: Specification. Springer, New York 1992Google Scholar
  22. 22.
    Michael MM: High performance dynamic lock-free hash tables and list-based sets. In: Proceedings of the fourteenth annual ACM symposium on Parallel algorithms and architectures. ACM Press 2002, pp 73-82Google Scholar
  23. 23.
    Owre S, Shankar N, Rushby JM, Stringer-Calvert DWJ: PVS Version 2.4, System Guide, Prover Guide, PVS Language Reference (2001) !http://pvs.csl.sri.com!Google Scholar
  24. 24.
    Rajwar R, Goodman JR: Transactional lock-free execution of lock-based programs. In: Tenth international conference on architectural support for programming languages and operating systems on Proceedings of the 10th international conference on architectural support for programming languages and operating systems (ASPLOS-X). ACM Press 2002, pp 5-17Google Scholar
  25. 25.
    Shalev O, Shavit N: Split-ordered lists: lock-free extensible hash tables. In: Proceedings of the twenty-second annual symposium on Principles of distributed computing. ACM Press 2003, pp 102-111Google Scholar
  26. 26.
    Sundell H, Tsigas P: Scalable and lock-free concurrent dictionaries. In: Proceedings of the 2004 ACM symposium on Applied computing. ACM Press 2004, pp 1438-1445Google Scholar
  27. 27.
    Valois JD: Implementing lock-free queues. In: Proceedings of the seventh international conference on Parallel and Distributed Computing Systems, 1994, pp 64-69Google Scholar
  28. 28.
    Valois JD: Lock-free linked lists using compare-and-swap. In: Proceedings of the fourteenth annual ACM symposium on Principles of distributed computing. ACM Press 1995, pp 214-222. See also Valois JD: ERRATA. Lock-free linked lists using compare-and-swap. Unpublished manuscript (1995)Google Scholar
  29. 29.
    Wirth N: Algorithms \(+\) Data Structures \(=\) Programs. Prentice Hall 1976Google Scholar

Copyright information

© Springer-Verlag Berlin/Heidelberg 2005

Authors and Affiliations

  1. 1.Department of Mathematics and Computing ScienceUniversity of GroningenGroningenThe Netherlands
  2. 2.Department of Mathematics and Computing ScienceEindhoven University of TechnologyEindhovenThe Netherlands
  3. 3.CWIAmsterdamThe Netherlands

Personalised recommendations