Recalibrating Fine-Grained Locking in Parallel Bucket Hash Tables

  • Ákos Dudás
  • Sándor Juhász
  • Sándor Kolumbán
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7686)


Mutual exclusion protects data structures in parallel environments in order to preserve data integrity. A lock being held effectively blocks the execution of all other threads wanting to access the same shared resource until the lock is released. This blocking behavior reduces the level of parallelism causing performance loss. Fine grained locking reduces the contention for the locks resulting in better throughput, however, the granularity, i.e. how many locks to use, is not straightforward. In large bucket hash tables, the best approach is to divide the table into blocks, each containing one or more buckets, and locking these blocks independently. The size of the block, for optimal performance, depends on the time spent within the critical sections, which depends on the table’s internal properties, and the arrival intensity of the queries. A queuing model is presented capturing this behavior, and an adaptive algorithm is presented fine-tuning the granularity of locking (the block size) to adapt to the execution environment.


Queue Length Hash Table Critical Section Mutual Exclusion Arrival Intensity 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Barnat, J., Ročkai, P.: Shared Hash Tables in Parallel Model Checking. Electronic Notes in Theoretical Computer Science 198(1), 79–91 (2008)CrossRefGoogle Scholar
  2. 2.
    Brandenburg, B., Calandrino, J.M., Block, A., Leontyev, H., Anderson, J.H.: Real-Time Synchronization on Multiprocessors: To Block or Not to Block, to Suspend or Spin? In: 2008 IEEE Real-Time and Embedded Technology and Applications Symposium, pp. 342–353. IEEE Computer Society Press, St. Louis (2008)CrossRefGoogle Scholar
  3. 3.
    Gao, H., Groote, J.F., Hesselink, W.H.: Lock-free dynamic hash tables with open addressing. Distributed Computing 18(1), 21–42 (2005)CrossRefGoogle Scholar
  4. 4.
    Gilbert, D.C.: Modeling spin locks with queuing networks. ACM SIGOPS Operating Systems Review 12(1), 29–42 (1978)CrossRefGoogle Scholar
  5. 5.
    Harrison, P., Patel, N.M.: Performance Modelling of Communication Networks and Computer Architectures. Addison-Wesley (1992)Google Scholar
  6. 6.
    Herlihy, M., Shavit, N., Tzafrir, M.: Hopscotch Hashing. In: Taubenfeld, G. (ed.) DISC 2008. LNCS, vol. 5218, pp. 350–364. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  7. 7.
    Juhász, S., Dudás, A.: Adapting hash table design to real-life datasets. In: Proc. of the IADIS European Conference on Informatics 2009, Part of the IADIS Multiconference of Computer Science and Information Systems 2009, Algarve, Portugal, pp. 3–10 (June 2009)Google Scholar
  8. 8.
    Kim, W., Voss, M.: Multicore Desktop Programming with Intel Threading Building Blocks. IEEE Software 28(1), 23–31 (2011)CrossRefGoogle Scholar
  9. 9.
    Klots, B., Bamford, R.J.: Method and apparatus for dynamic lock granularity escalation and de-escalation in a computer system (1998)Google Scholar
  10. 10.
    Knuth, D.E.: The art of computer programming, vol 3. Addison-Wesley (November 1973)Google Scholar
  11. 11.
    Laarman, A., van de Pol, J., Weber, M.: Boosting Multi-Core Reachability Performance with Shared Hash Tables. In: 10th International Conference on Formal Methods in Computer-Aided Design (April 2010)Google Scholar
  12. 12.
    Larson, P.A., Krishnan, M.R., Reilly, G.V.: Scaleable hash table for shared-memory multiprocessor system (April 2003)Google Scholar
  13. 13.
    Lea, D.: Hash table util.concurrent.ConcurrentHashMap, revision 1.3, in JSR-166, the proposed Java Concurrency Package (2003)Google Scholar
  14. 14.
    Li, Q., Moon, B.: Distributed cooperative Apache web server. In: Proceedings of the Tenth International Conference on World Wide Web, WWW 2001, pp. 555–564. ACM Press, New York (2001)CrossRefGoogle Scholar
  15. 15.
    Mellor-Crummey, J.M., Scott, M.L.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Transactions on Computer Systems 9(1), 21–65 (1991)CrossRefGoogle Scholar
  16. 16.
    Michael, M.M.: High performance dynamic lock-free hash tables and list-based sets. In: ACM Symposium on Parallel Algorithms and Architectures, pp. 73–82 (2002)Google Scholar
  17. 17.
    Ning, Z., Cox, A.J., Mullikin, J.C.: SSAHA: a fast search method for large DNA databases. Genome Research 11(10), 1725–1729 (2001)CrossRefGoogle Scholar
  18. 18.
    Purcell, C., Harris, T.: Non-blocking Hashtables with Open Addressing. In: Fraigniaud, P. (ed.) DISC 2005. LNCS, vol. 3724, pp. 108–121. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  19. 19.
    Stewart, W.J.: Probability, Markov chains, queues, and simulation: the mathematical basis of performance modeling. Princeton University Press (2009)Google Scholar
  20. 20.
    Treiber, R.K.: Systems Programming: Coping with Parallelism (Research Report RJ 5118). Tech. rep., IBM Almaden Research Center (1986)Google Scholar
  21. 21.
    Veal, B., Foong, A.: Performance scalability of a multi-core web server. In: Proceedings of the 3rd ACM/IEEE Symposium on Architecture for Networking and Communications Systems, ANCS 2007, p. 57. ACM Press, New York (2007)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Ákos Dudás
    • 1
  • Sándor Juhász
    • 1
  • Sándor Kolumbán
    • 1
  1. 1.Department of Automation and Applied InformaticsBudapest University of Technology and EconomicsBudapestHungary

Personalised recommendations