Skip to main content
QUICK REVIEW

[Paper Review] Concurrent Hash Tables: Fast and General?(!)

Tobias Maier, Peter Sanders|arXiv (Cornell University)|Jan 15, 2016
Algorithms and Data CompressionComputer Science20 references6 citations
TL;DR

This paper presents a highly optimized, lock-free concurrent hash table based on linear probing that supports dynamic resizing and general key-value types while maintaining near-peak performance. It demonstrates that with careful design, the performance penalty for adding scalability features—like growth, deletion, and arbitrary data types—is minimal, achieving up to an order of magnitude faster performance than existing general-purpose concurrent hash tables, especially under contention.

ABSTRACT

Concurrent hash tables are one of the most important concurrent data structures with numerous applications. Since hash table accesses can dominate the execution time of the overall application, we need implementations that achieve good speedup. Unfortunately, currently available concurrent hashing libraries turn out to be far away from this requirement in particular when contention on some elements occurs. Our starting point for better performing data structures is a fast and simple lock-free concurrent hash table based on linear probing that is limited to word-sized key-value types and does not support dynamic size adaptation. We explain how to lift these limitations in a provably scalable way and demonstrate that dynamic growing has a performance overhead comparable to the same generalization in sequential hash tables. We perform extensive experiments comparing the performance of our implementations with six of the most widely used concurrent hash tables. Ours are considerably faster than the best algorithms with similar restrictions and an order of magnitude faster than the best more general tables. In some extreme cases, the difference even approaches four orders of magnitude.

Motivation & Objective

  • To address the poor scalability of existing general-purpose concurrent hash tables under real-world workloads, especially with contention and dynamic resizing.
  • To investigate whether performance can be preserved when extending a fast, bounded, word-sized linear probing hash table to support dynamic resizing, deletions, and arbitrary data types.
  • To evaluate the trade-offs between performance and generality in concurrent hash table design, particularly in multi-core environments.
  • To demonstrate that the performance cost of generalization is comparable to that in sequential hash tables, making it viable for performance-critical applications.

Proposed method

  • Design a lock-free linear probing hash table optimized for word-sized keys and values, using only atomic compare-and-swap (CAS) operations.
  • Extend the base design to support dynamic resizing via a novel, scalable migration algorithm that avoids global synchronization bottlenecks.
  • Introduce a marking-based approach for safe deletion and memory reclamation, enabling efficient space reuse without blocking.
  • Leverage Intel Hardware Transactional Search (TSX) to accelerate insertions and updates in high-contention scenarios.
  • Implement support for arbitrary key-value types using serialization and pointer-based storage, minimizing performance impact.
  • Use partial template specialization and abstraction layers to expose a unified, user-friendly interface while preserving performance for specialized cases.

Experimental results

Research questions

  • RQ1Can a lock-free linear probing hash table be extended to support dynamic resizing with minimal performance degradation compared to a fixed-size version?
  • RQ2How does the performance of a highly optimized, bounded concurrent hash table compare to general-purpose implementations under contention and varied workloads?
  • RQ3What is the performance overhead of supporting arbitrary key-value types and deletions in a concurrent hash table, and can it be kept comparable to sequential hash table growth?
  • RQ4To what extent does hardware transactional memory improve performance in concurrent insertions and updates?
  • RQ5Can a single implementation efficiently support both specialized and general use cases through abstraction and template specialization?

Key findings

  • The bounded, word-sized linear probing hash table outperforms all competitors by up to four orders of magnitude under high-contention find operations, demonstrating the severe performance cost of using locks or CAS in read-heavy scenarios.
  • The performance overhead of dynamic resizing is less than a factor of two for insertions and updates, and negligible for find operations—comparable to sequential hash tables.
  • Among general-purpose implementations, only TBB, Cuckoo, and RCU support arbitrary data types, but they are at least an order of magnitude slower than the proposed implementation for insertions.
  • The Cuckoo hash table is only five times slower for insertions but 5,600 times slower under contention, highlighting the fragility of some general-purpose designs.
  • The proposed growing mechanism with marking-based migration achieves better performance than globally synchronized growing, especially in update-heavy workloads.
  • Hardware transactional memory (Intel TSX) further accelerates insertions and updates, showing potential for performance gains in high-contention scenarios.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.