Lock-Free Hash Table Resizing via Atomic Pointer Advancement

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Concurrent computing environments face performance constraints due to process and thread contention, latency, and inefficient memory usage, particularly in multi-core systems, where existing lock-free hash table implementations struggle with dynamic resizing and thread safety.

Innovation Solution

Implementing lock-free hash tables using an array-based, open addressing approach that allows dynamic resizing and prevents duplicates, with non-blocking updates and thread-safe operations through versioning of key/value pairs, enabling efficient management of hash sets and hash maps in multi-threaded environments.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locking mechanisms are used to manage concurrency in hash tables, then thread safety is improved, but wait times and thread stalls increase significantly

Engineering Contradiction:
Improvethread safetyVSAvoidwait times
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts the locking mechanism entirely from the hash table implementation, replacing it with lock-free atomic operations. Each bucket uses compare-and-swap (CAS) instructions to achieve thread safety without actual locks, eliminating wait times and thread stalls while maintaining reliability.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the mechanical locking system with atomic instruction-based synchronization. Instead of using physical or software locks that cause threads to block and wait, the system uses CAS operations that allow threads to proceed concurrently while still ensuring thread safety through atomic compare-and-swap semantics.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Reliability

If lock-free linked lists are used for hash table buckets, then thread safety is improved, but the A-B-A problem occurs where state appears identical but has been secretly modified

Engineering Contradiction:
Improvethread safetyVSAvoidalgorithm complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent changes the state parameters used in CAS operations to include version numbers or generation counters alongside the actual data. This allows the system to detect A-B-A problems by comparing not just the data value but also its version, preventing silent modifications from going undetected while maintaining thread safety.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If array-based open addressing is used, then dynamic resizing is enabled, but preventing duplicates becomes more difficult

Engineering Contradiction:
Improvedynamic resizingVSAvoidduplicate prevention
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent performs preliminary duplicate checking by computing the hash and checking for existing entries before attempting to insert new data. This preliminary action ensures that duplicates are prevented even in the dynamic array-based open addressing scheme, where the structure can change size during operation.

Inventive Principle:
Principle #10Preliminary action

4Productivity

If traditional hash table implementations are used in multi-core systems, then constant amortized cost is achieved, but process and thread contention increases

Engineering Contradiction:
Improveoperation speedVSAvoidcontention management
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the hash table into multiple independent buckets that can be accessed concurrently by different threads. Each bucket operates independently with its own atomic operations, allowing multiple cores to work on different buckets simultaneously without contention, while maintaining constant amortized cost through the segmented parallel structure.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11409447B1System and method for implementing non-blocking, concurrent hash tables
Publication Date: 2022.08.09 TRAVELPORT TECH LLC
  • US11409447B1 patent drawing
  • US11409447B1 patent drawing
  • US11409447B1 patent drawing

AI summary

A computer-implemented method of resizing a data structure includes storing a first hash index comprising x elements, wherein x is a positive integer greater than two, determining that the first hash index needs to expand, allocating a second hash index, wherein the second index contains at least x+1 elements, attempting, by a first thread, to advance a first pointer from the first hash index to the second hash index, attempting, by a second thread, to advance the first pointer from the first hash index to the second hash index, where only one of the first thread or the second thread will advance the first pointer based on an atomic operation.