Skip to main content
Log in

Abstract

In this work we present the first design and implementation of a wait-free hash map. Our multiprocessor data structure allows a large number of threads to concurrently insert, get, and remove information. Wait-freedom means that all threads make progress in a finite amount of time—an attribute that can be critical in real-time environments. This is opposed to the traditional blocking implementations of shared data structures which suffer from the negative impact of deadlock and related correctness and performance issues. We only use atomic operations that are provided by the hardware; therefore, our hash map can be utilized by a variety of data-intensive applications including those within the domains of embedded systems and supercomputers. The challenges of providing this guarantee make the design and implementation of wait-free objects difficult. As such, there are few wait-free data structures described in the literature; in particular, there are no wait-free hash maps. It often becomes necessary to sacrifice performance in order to achieve wait-freedom. However, our experimental evaluation shows that our hash map design is, on average, 7 times faster than a traditional blocking design. Our solution outperforms the best available alternative non-blocking designs in a large majority of cases, typically by a factor of 15 or higher.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Boost, Boost c++ libraries. Available: http://www.boost.org/. January 2012 [Online]

  2. Click, C.: A lock-free hash table. http://www.azulsystems.com/events/javaone_2007/2007_LockFreeHash.pdf. January (2012)

  3. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  4. Dechev, D.: The aba problem in multicore data structures with collaborating operations. In: 2011 7th International Conference on Collaborative Computing: Networking, Applications and Worksharing (CollaborateCom), October 2011, pp. 158 –167

  5. Dechev, D., Pirkelbauer, P., Stroustrup, B.: Lock-free dynamically resizable arrays. In: Shvartsman, M. (ed.) Principles of Distributed Systems, ser. Lecture Notes in Computer Science, vol. 4305, pp. 142–156. Springer, Berlin (2006)

  6. Dybnis, J.: nbds. https://code.google.com/p/nbds/. October 2014

  7. Fagin, R., Nievergelt, J., Pippenger, N., Strong, H.R.: Extendible hashing—a fast access method for dynamic files. ACM Trans. Database Syst. 4, 315–344 (1979)

    Article  Google Scholar 

  8. Feldman, S., LaBorde, P., Dechev, D.: Concurrent multi-level arrays: wait-free extensible hash maps. In: 13th International Conference on Embedded Computer Systems: Architectures, Modeling, and Simulation (SAMOS XIII) (2013)

  9. Fraser, K.: Practical lock-freedom. In: Kuhn, M. (ed.) Computer Laboratory. Cambridge University Press, Cambridge (2004)

  10. Gao, H., Groote, J., Hesselink, W.: Almost wait-free resizable hashtables. In: Parallel and Distributed Processing Symposium, 2004. Proceedings. 18th International, April 2004, p. 50

  11. Harris, T.L.: A pragmatic implementation of non-blocking linked-lists. In: Proceedings of the 15th International Conference on Distributed Computing, ser. DISC ’01, pp. 300–314. Springer, London, UK (2001)

  12. Hendler, D., Shavit, N., Yerushalmi, L.: A scalable lock-free stack algorithm. In: Proceedings of the Sixteenth Annual ACM Symposium on Parallelism in Algorithms and Architectures, ser. SPAA ’04, pp. 206–215. ACM, New York, NY, USA (2004)

  13. Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers, New York (2008)

    Google Scholar 

  14. Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)

    Article  Google Scholar 

  15. Intel, Intel threading building blocks. http://threadingbuildingblocks.org/. November 2011 [Online]

  16. ISO/IEC, Standard for programming language c++. September 2011

  17. Janssen, C.L., Adalsteinsson, H., Kenny, J.P.: Using simulation to design extremescale applications and architectures: programming model exploration. SIGMETRICS Perform. Eval. Rev. 38, 4–8 (2011)

    Article  Google Scholar 

  18. Khiszinsky, M.: Concurrent data structures. http://libcds.sourceforge.net/. May 2013

  19. Kogan, A., Petrank, E.: Wait-free queues with multiple enqueuers and dequeuers. In: Proceedings of the 16th ACM Symposium on Principles and Practice of Parallel Programming, ser. PPoPP ’11, pp. 223–234. ACM, New York, NY, USA (2011)

  20. Larson, P.-K.: Dynamic hashing. BIT Numer Math 18, 184–201 (1978). doi:10.1007/BF01931695

    Article  MathSciNet  MATH  Google Scholar 

  21. Lockless Inc., Technical specifications for the lockless inc. memory allocator. http://locklessinc.com/technical_allocator.shtml. December 2011

  22. Marçais, G., Kingsford, C.: A fast, lock-free approach for efficient parallel counting of occurrences of k-mers. Bioinformatics 27(6), 764–770 (2011)

    Article  Google Scholar 

  23. Michael, M.M.: High performance dynamic lock-free hash tables and list-based sets. In: SPAA ’02: Proceedings of the Fourteenth Annual ACM Symposium on Parallel Algorithms and Architectures, pp. 73–82. ACM Press, New York, NY, USA (2002)

  24. Michael, M.M.: Hazard pointers: safe memory reclamation for lock-free objects. IEEE Trans. Parallel Distrib. Syst. 15(6), 491–504 (2004)

    Article  Google Scholar 

  25. Michael, M.M., Scott, M.L.: Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In: Proceedings of the Fifteenth Annual ACM Symposium on Principles of Distributed Computing, ser. PODC ’96, pp. 267–275. ACM, New York, NY, USA (1996)

  26. Microsoft, System.collections.concurrent namespace. http://msdn.microsoft.com/en-us/library/system.collections.concurrent.aspx. Microsoft, 2011, .NET Framework 4

  27. Moir, M., Shavit, N.: Concurrent data structures. In: Mehta, D.P., Sahni, S. (eds.) Handbook of Data Structures and Applications, pp. 47–1–47–30. Chapman and Hall/CRC Press, Boca raton, FL (2007)

  28. Pingali, K., Nguyen, D., Kulkarni, M., Burtscher, M., Hassaan, M.A., Kaleem, R., Lee, T.-H., Lenharth, A., Manevich, R., Méndez-Lojo, M., Prountzos, D., Sui, X.: The tao of parallelism in algorithms. SIGPLAN Not. 46, 12–25 (2011)

    Article  Google Scholar 

  29. SevOne, Network performance management. http://www.sevone.com/solutions. June 2012

  30. Shalev, O., Shavit N.: Split-ordered lists: lock-free extensible hash tables. In: PODC ’03: Proceedings of the Twenty-Second Annual Symposium on Principles of Distributed Computing, pp. 102–111. ACM Press, New York, NY, USA (2003)

  31. Sundell, H.: Wait-free reference counting and memory management. In: Parallel and Distributed Processing Symposium, 2005. Proceedings. 19th IEEE International, April 2005, p. 24b

  32. Sundell, H., Tsigas, P.: Lock-free and practical doubly linked list-based deques using single-word compare-and-swap. In: OPODIS 2004: Principles of Distributed Systems, 8th International Conference, LNCS, vol. 3544, pp. 240–255 (2005)

  33. Trelles, O., Prins, P., Snir, M., Jansen, R.C.: Big data, but are we ready? Nat. Rev. Genet. 12(3), 224–224 (2011)

    Article  Google Scholar 

  34. Williams, J.R., Holmes, D., Tilke, P.: Parallel computation particle methods for multi-phase fluid flow with application oil reservoir characterization. In: Particle-Based Methods, ser. Computational Methods in Applied Sciences. Springer Netherlands, vol. 25, pp. 113–134 (2011)

  35. Yi, Q.: POET: a scripting language for applying parameterized source-to-source program transformations. Software Pract. Exp. 42(6), 675–706 (2012)

  36. Zhao, Y., Tang, H., Ye, Y.: RAPSearch2: a fast and memory-efficient protein similarity search tool for next generation sequencing data. Bioinformatics 28(1), 125–126 (2011)

Download references

Acknowledgments

The authors would like to thank the anonymous reviewers for their detailed and helpful suggestions. This research is funded by the National Science Foundation (NSF) under Grant Numbers 1218100 and DUE-0966249; by the NSF Scholarships in Science, Technology, Engineering, and Mathematics (S-STEM) program under Award No. 0806931; by the UCF Office of Research and Commercialization; by the Department of Energy; and by Sandia National Laboratories.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Pierre Laborde.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Laborde, P., Feldman, S. & Dechev, D. A Wait-Free Hash Map. Int J Parallel Prog 45, 421–448 (2017). https://doi.org/10.1007/s10766-015-0376-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10766-015-0376-3

Keywords

Navigation