Skip to main content
QUICK REVIEW

[Paper Review] Cache-Aware Lock-Free Concurrent Hash Tries

Aleksandar Prokopec, Phil Bagwell|arXiv (Cornell University)|Sep 18, 2017
Distributed systems and fault toleranceComputer Science13 references11 citations
TL;DR

This paper presents a lock-free, cache-aware concurrent hash trie (Ctrie) that uses single-word compare-and-swap (CAS) instructions to enable thread-safe insert, lookup, and remove operations without blocking. The data structure maintains space efficiency through dynamic contraction after removals and ensures linearizability and lock-freedom, achieving high performance and scalability in concurrent workloads without stop-the-world resizing phases.

ABSTRACT

This report describes an implementation of a non-blocking concurrent shared-memory hash trie based on single-word compare-and-swap instructions. Insert, lookup and remove operations modifying different parts of the hash trie can be run independent of each other and do not contend. Remove operations ensure that the unneeded memory is freed and that the trie is kept compact. A pseudocode for these operations is presented and a proof of correctness is given -- we show that the implementation is linearizable and lock-free. Finally, benchmarks are presented which compare concurrent hash trie operations against the corresponding operations on other concurrent data structures, showing their performance and scalability.

Motivation & Objective

  • To design a concurrent hash trie that avoids locks and ensures progress even under thread failure or delay.
  • To maintain space efficiency by dynamically contracting the trie after key removals.
  • To eliminate stop-the-world resizing phases, enabling real-time operation.
  • To prove linearizability and lock-freedom formally, ensuring correctness under concurrent access.
  • To evaluate performance against existing concurrent data structures through comprehensive benchmarks.

Proposed method

  • The Ctrie uses a hash array mapped trie structure with bitmap-indexed arrays to ensure space efficiency and cache-aware memory access.
  • All operations (insert, lookup, remove) are implemented using single-word compare-and-swap (CAS) instructions to avoid locks.
  • The data structure maintains invariants through atomic updates to bitmaps and array entries, ensuring consistency during concurrent modifications.
  • A cleanup and contraction mechanism removes null-inodes and resurrects tomb-inodes into snodes to compact the trie and reduce depth.
  • The algorithm includes a 'tombCompress' phase that propagates compaction upward from leaves to root, ensuring no more than one tip of length 1 remains.
  • A formal correctness proof establishes linearizability and lock-freedom using state invariants and finite-state progression arguments.

Experimental results

Research questions

  • RQ1Can a concurrent hash trie be implemented without locks while maintaining space efficiency and cache-awareness?
  • RQ2How can removal operations ensure that unused memory is freed and the trie remains compact?
  • RQ3Does the absence of global synchronization or stop-the-world resizing improve performance and scalability in concurrent workloads?
  • RQ4Is the proposed data structure linearizable and lock-free under all execution scenarios?
  • RQ5How does the performance of the Ctrie compare to other concurrent data structures in practice?

Key findings

  • The Ctrie achieves linearizability and lock-freedom, ensuring that at least one thread makes progress in any execution sequence.
  • The data structure dynamically contracts after removals, maintaining optimal depth and minimizing memory usage.
  • Benchmarks show the Ctrie outperforms other concurrent data structures in terms of throughput and scalability under high contention.
  • The absence of global synchronization phases enables real-time operation with predictable performance.
  • The implementation scales well with increasing thread counts, demonstrating superior performance on concurrent workloads compared to lock-based alternatives.
  • The proof of correctness confirms that all operations are safe under arbitrary interleavings and thread failures.

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.