Lock-Free Shared Memory Hash Table for Concurrent Access

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In shared cache memory systems, existing technologies face challenges in managing conflicts between multiple services accessing the same cache, leading to inefficiencies and increased latency due to the use of locks, which are not effective for inter-process communication and can result in starvation.

Innovation Solution

A lock-free shared memory system is implemented using a hash table with a linked list of buckets, where readers access data via offsets and the writer updates metadata in atomic actions, ensuring data consistency and freshness without locks, allowing multiple readers and a single writer to access shared memory concurrently.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locks are used to resolve conflicting operations on shared cache memory, then data consistency is maintained, but system latency increases and service starvation may occur

Engineering Contradiction:
Improvedata consistencyVSAvoidsystem latency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts the locking mechanism from the shared memory access protocol and replaces it with versioned metadata checks. Readers independently verify data freshness by comparing version numbers in metadata without acquiring locks, while writers update metadata atomically to signal changes. This separation eliminates lock-related latency and starvation while maintaining consistency through version validation.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the mechanical locking system with a software-based versioning and validation mechanism. Instead of using hardware or OS-level locks that block access, the system uses metadata version numbers that readers check atomically with writers. This substitution transforms the conflict resolution from a blocking mechanical approach to a non-blocking information-based approach, reducing latency while preserving data consistency.

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

2Reliability

If locks are used to prevent simultaneous access to shared cache memory, then data consistency is ensured, but service starvation occurs

Engineering Contradiction:
Improvedata consistencyVSAvoidservice throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent removes the locking mechanism from the shared memory access control and replaces it with independent version-based validation for readers. Multiple readers can simultaneously access different cache entries without acquiring locks, while writers use atomic metadata updates to signal changes. This extraction eliminates the blocking behavior that causes starvation, allowing all services to make progress concurrently while maintaining data consistency through version checks.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If separate cache memory is allocated for each service, then no access conflicts occur, but memory efficiency decreases

Engineering Contradiction:
Improveaccess conflict avoidanceVSAvoidmemory utilization
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent merges separate service-specific cache memories into a single shared cache memory structure. Multiple services share the same physical memory space with different data entries organized in a hash table. The merging is made safe through the use of versioned metadata and atomic update operations, allowing concurrent access without conflicts while dramatically improving memory utilization compared to isolated per-service caches.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent introduces metadata with version numbers as an intermediary between readers and writers in the shared cache. This metadata layer mediates access conflicts by providing readers with information about data freshness without requiring exclusive access. The intermediary enables multiple services to safely share cache memory by allowing readers to independently verify data validity while writers atomically update version information, resolving the conflict between sharing and consistency.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Loss of time

If lock-free mechanisms are implemented for inter-process shared memory, then access latency is reduced, but implementation complexity increases

Engineering Contradiction:
Improveaccess latencyVSAvoiddata structure complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The patent segments the shared cache entry into distinct components: data payload and metadata with version numbers. This segmentation allows readers to independently validate data freshness by checking only the metadata version field without needing complex synchronization protocols. The simple version number comparison provides lock-free access with minimal complexity, avoiding the need for sophisticated algorithms like compare-and-swap loops or hazard pointers while still achieving low-latency concurrent access.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10235292B2Method and system for implementing lock free shared memory with single writer and multiple readers
Publication Date: 2019.03.19 DELL PROD LP
  • US10235292B2 patent drawing
  • US10235292B2 patent drawing
  • US10235292B2 patent drawing

AI summary

A method and a system for implementing a lock-free shared memory accessible by a plurality of readers and a single writer are provided herein. The method including: maintaining a memory accessible by the readers and the writer, wherein the memory is a hash table having at least one linked list of buckets, each bucket in the linked list having: a bucket ID, a pointer to an object, and a pointer to another bucket; calculating a pointer to one bucket of the linked list of buckets based on a hash function in response to a read request by any of the readers; and traversing the linked list of buckets, to read a series of objects corresponding with the traversed buckets, while checking that the writer has not: added, amended, or deleted objects pointed to by any of said traversed buckets, wherein said checking is carried out in a single atomic action.