- The paper introduces a lock-free linear-probing hash table that minimizes per-cell metadata while ensuring wait-free lookups and lock-free insert/delete operations.
- It employs tentative/final states and revalidate tags to manage concurrent operations robustly, allowing immediate reuse of tombstoned cells without rebuilding the table.
- Benchmark results indicate that the design maintains cache locality and achieves amortized performance comparable to sequential linear probing under moderate contention.
Space-Efficient Lock-Free Linear-Probing Hash Table: A Technical Synthesis
Motivation and Context
The canonical linear-probing hash table is well-established for achieving high memory locality and space efficiency in sequential (single-threaded) environments, offering compact memory layouts and minimal pointer indirection. However, scaling these advantages into the concurrent (multi-threaded) scenario presents substantial algorithmic complexity. Many lock-free or non-blocking concurrent hash tables in the literature default to chaining or employ indirection, pointer-rich structures, heavy per-cell metadata, periodic rebuilding, or resort to locking—each of these breaks either locality, space efficiency, or both.
Prior concurrent linear probing implementations frequently either sacrifice space complexity (by requiring, for example, unbounded per-entry metadata to handle synchronization and ABA detection) or restrict concurrency and safe reclamation, especially in the presence of deletions (e.g., managing tombstones and handling duplicate inserts for the same key).
Technical Contributions
This paper introduces the first lock-free linear-probing hash table that employs minimal per-cell metadata and supports safe space reclamation of deleted entries without necessitating table-wide rebuilds. The key technical attributes are:
- Wait-free lookups: Any lookup operation (lookup(v)) completes in a bounded number of steps, independent of contention.
- Lock-free insert/delete: Insert (insert(v)) and delete (delete(v)) operations are linearizable and lock-free.
- Space efficiency: Each cell contains ⌈log2U⌉+O(1) bits (with LL/SC), or ⌈log2U⌉+min{⌈log2m⌉,⌈log2n⌉}+O(1) bits (with CAS), where U is the key domain, m is the table capacity, and n is the number of processes. This sharply contrasts previous lock-free schemes, e.g., Purcell-Harris [PurcellHarris05], which use unbounded per-entry data.
- No rebuilding for safety: Table cells occupied by keys can be recycled safely after deletions, removing the necessity for periodic table rebuilds to reclaim "tombstoned" space.
- Probe-bound runtime: In executions with no overlapping inserts for the same key, the expected amortized step complexity per operation matches sequential linear probing within additive contention.
The design leverages two variants: one based on the insert(v)0 primitive (load-linked/store-conditional), and one on the ubiquitous insert(v)1 (compare-and-swap). The insert(v)2 version achieves minimal per-cell metadata overhead, as proper pairing ensures synchronized updates without the need for explicit version counters or per-thread IDs. The insert(v)3 version introduces small additional indices (cell or thread), logarithmic in either the process number or the table size.
Key synchronization mechanisms:
- Tentative/final states and revalidate tags allow speculation and conflict resolution for in-flight inserts/deletes on the same key with minimal coordination.
- Insert Elimination: If multiple concurrent inserts of the same key occur, an invariant is maintained where only one "finalized" copy survives, and all others are cleaned up or overwritten with collision/deleted markers. The winner is determined by probe order to avoid circular eliminations.
- Tombstone management: Unlike traditional tombstone use (where tombstones accumulate, forcing periodic rebuilding), the design enables safe reuse of tombstoned slots immediately, even under concurrency, provided no in-flight conflicting operation is depending on the cell.
In the insert(v)4 variant, a “marked” state with process/cell IDs is employed to temporarily reserve tentative copies for potential elimination. This avoids the pitfalls of ABA and enables ownership identification during elimination phases without allocating unbounded extra metadata.
Correctness and Linearizability
A complete formal linearizability proof is given, adapted to the parallel hash table context:
- Operations are shown to appear atomically at one point during their execution ("linearization points"), and per-key, per-operation histories are merged to a sequential, dictionary-compliant execution.
- The correctness argument addresses both non-mutator (lookup, failed insert, failed delete) and mutator (successful insert/delete) operations.
- The notion of “insert sequences” (chains of overlapping inserts on the same key) structures the argument that at any time, for any key, at most one finalized copy can exist, and eliminations proceed monotonically towards the beginning of the probe run.
When a cell contains a tentative copy, all subsequent operations treat the key as present ("helpful" semantics). This is a critical point for multiprocess safety under the possibility of preemption and delayed clean-up.
For deletions, while backward-shifting is theoretically more memory-efficient after deletes, real concurrent backward-shifting introduces prohibitive complexity and metadata overhead; tombstone-based management with bounded metadata and careful conflict resolution achieves robust results in practice.
Amortized Step Complexity
Assuming no overlapping concurrent insertions for the same key, the step complexity for each operation is insert(v)5, where insert(v)6 parameterizes the load factor (insert(v)7 with insert(v)8 keys, insert(v)9 cells) and delete(v)0 is "point contention" (the maximum number of overlapping operations on a given key). This matches classical sequential linear probing [Knuth1963OpenAddressing] up to additive concurrency effects. Under adversarial scheduling, only delete(v)1 "excess" tombstones are ever present.
The scheme sharply outperforms previous lock-free linear probing methods in per-cell overhead, wait-free lookups, and robustness under contention. Unlike prior algorithms:
- It requires no unbounded per-cell timestamps or descriptors.
- It does not demand rebuilding to reclaim tombstoned space.
- It supports safe and immediate space reclamation after deletes.
- It achieves these without pointer indirection or auxiliary arrays, thus preserving cache performance and data locality.
Recently proposed history-independent, concurrent open addressing approaches (e.g., [HIHashTableSTOC25]) and techniques based on helping and rich metadata [PurcellHarris05] are functionally dominated by this construction in both the concurrency and efficiency metrics for the offered feature set.
Implications and Future Directions
From a practical perspective, this design advances the deployment of high-performance, scalable associative arrays in concurrent, memory-constrained environments. The methodology—especially the lock-free cell state protocol—can readily be incorporated into managed run-time systems, object stores, and parallel in-memory indices where pointer avoidance and cache efficiency are paramount.
On the theoretical front, the hash table approaches the cell-probe space lower bounds for dynamic dictionaries [LiLYZ23, BFKKL22] within the limitations of the concurrency model, and establishes a new baseline for space-efficient lock-free objects. Provably succinct lock-free dictionaries remain open, as does the challenge of concurrent backward-shift deletion or history-independent dynamic resizing with similar efficiency.
Potential research advances include dynamic resizing without data migration, extensions for greater deletion locality, and application to specialized domains (e.g., persistent memory, NUMA-aware structures). New progress on constant-time emulation of delete(v)2 using delete(v)3 for multi-word state [blellochWei20] may further drive reductions in per-cell overhead and broaden architectural portability.
Conclusion
This work realizes a lock-free, space-efficient linear probing hash table that provides wait-free lookup, lock-free updates, and memory usage approaching information-theoretic optima, without resorting to rebuilding or unbounded metadata. The approach resets the tradeoff frontier for concurrent open addressing, offering both theoretical robustness and immediate practical relevance in scenarios requiring compact, concurrent key-value stores.