International Journal of Parallel Programming

, Volume 45, Issue 3, pp 421–448

A Wait-Free Hash Map

Article
  • 249 Downloads

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.

Keywords

Lock-free Wait-free Non-blocking Hash map Data Structures Parallel programming Concurrency 

References

  1. 1.
    Boost, Boost c++ libraries. Available: http://www.boost.org/. January 2012 [Online]
  2. 2.
    Click, C.: A lock-free hash table. http://www.azulsystems.com/events/javaone_2007/2007_LockFreeHash.pdf. January (2012)
  3. 3.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)MATHGoogle Scholar
  4. 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 –167Google Scholar
  5. 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)Google Scholar
  6. 6.
    Dybnis, J.: nbds. https://code.google.com/p/nbds/. October 2014
  7. 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)CrossRefGoogle Scholar
  8. 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)Google Scholar
  9. 9.
    Fraser, K.: Practical lock-freedom. In: Kuhn, M. (ed.) Computer Laboratory. Cambridge University Press, Cambridge (2004)Google Scholar
  10. 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. 50Google Scholar
  11. 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)Google Scholar
  12. 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)Google Scholar
  13. 13.
    Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers, New York (2008)Google Scholar
  14. 14.
    Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)CrossRefGoogle Scholar
  15. 15.
    Intel, Intel threading building blocks. http://threadingbuildingblocks.org/. November 2011 [Online]
  16. 16.
    ISO/IEC, Standard for programming language c++. September 2011Google Scholar
  17. 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)CrossRefGoogle Scholar
  18. 18.
    Khiszinsky, M.: Concurrent data structures. http://libcds.sourceforge.net/. May 2013
  19. 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)Google Scholar
  20. 20.
    Larson, P.-K.: Dynamic hashing. BIT Numer Math 18, 184–201 (1978). doi:10.1007/BF01931695 MathSciNetCrossRefMATHGoogle Scholar
  21. 21.
    Lockless Inc., Technical specifications for the lockless inc. memory allocator. http://locklessinc.com/technical_allocator.shtml. December 2011
  22. 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)CrossRefGoogle Scholar
  23. 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)Google Scholar
  24. 24.
    Michael, M.M.: Hazard pointers: safe memory reclamation for lock-free objects. IEEE Trans. Parallel Distrib. Syst. 15(6), 491–504 (2004)CrossRefGoogle Scholar
  25. 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)Google Scholar
  26. 26.
    Microsoft, System.collections.concurrent namespace. http://msdn.microsoft.com/en-us/library/system.collections.concurrent.aspx. Microsoft, 2011, .NET Framework 4
  27. 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)Google Scholar
  28. 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)CrossRefGoogle Scholar
  29. 29.
    SevOne, Network performance management. http://www.sevone.com/solutions. June 2012
  30. 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)Google Scholar
  31. 31.
    Sundell, H.: Wait-free reference counting and memory management. In: Parallel and Distributed Processing Symposium, 2005. Proceedings. 19th IEEE International, April 2005, p. 24bGoogle Scholar
  32. 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)Google Scholar
  33. 33.
    Trelles, O., Prins, P., Snir, M., Jansen, R.C.: Big data, but are we ready? Nat. Rev. Genet. 12(3), 224–224 (2011)CrossRefGoogle Scholar
  34. 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)Google Scholar
  35. 35.
    Yi, Q.: POET: a scripting language for applying parameterized source-to-source program transformations. Software Pract. Exp. 42(6), 675–706 (2012)Google Scholar
  36. 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)Google Scholar

Copyright information

© Springer Science+Business Media New York 2015

Authors and Affiliations

  1. 1.University of Central FloridaOrlandoUSA

Personalised recommendations