Lock-Free Shared-Memory Queues for Corruption-Free Process Communication

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing shared-memory communication systems face issues with data corruption, deadlocks, and interference due to the use of mutexes, unsafe buffer ownership transfer, and unprotected control data, which compromise the integrity and safety of data transfer between processes.

Innovation Solution

Implementing lock-free data structures with defined access rights and plausibility checks to manage memory region ownership, ensuring freedom from interference by using separate and redundant data structures to protect against corruption and deadlocks.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If mutexes are used to prevent data races in shared memory communication, then data integrity is improved, but deadlocks and system interference occur

Engineering Contradiction:
Improvedata integrityVSAvoiddeadlocks and interference
Core Design Contradiction:
ReliabilityVSObject-generated harmful factors

Solution Approach 1:

The patent extracts the problematic mutex locking mechanism from the shared memory access control and replaces it with a lock-free approach using atomic operations and hazard pointers. This removes the source of deadlocks while maintaining data integrity through alternative synchronization methods.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the mechanical locking system (mutexes) with a software-based atomic operation system using compare-and-swap (CAS) instructions and hazard pointer tracking. This substitution eliminates the need for physical lock acquisition and release, preventing deadlocks while ensuring safe concurrent access.

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

2Productivity

If buffer ownership is transferred between processes in shared memory, then communication efficiency is improved, but data corruption risks increase

Engineering Contradiction:
Improvecommunication efficiencyVSAvoiddata integrity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent implements feedback through hazard pointer tracking that continuously monitors buffer ownership status. When a buffer is being accessed, the hazard pointer provides feedback to prevent premature overwriting or deallocation, ensuring data integrity while maintaining efficient zero-copy communication.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent introduces hazard pointers as an intermediary mechanism between the buffer owner and potential corruptors. These pointers act as mediators that coordinate access without requiring mutual exclusion locks, allowing efficient ownership transfer while preventing data corruption through atomic operations.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Speed

If control data is stored unprotected in shared memory, then access speed is improved, but corruption by interfering processes occurs

Engineering Contradiction:
Improveaccess speedVSAvoiddata protection
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent applies preliminary action by pre-establishing hazard pointer protection around control data structures before access occurs. This proactive protection is set up in advance to prevent corruption without requiring slow protective measures during actual access, maintaining high speed while ensuring reliability.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP4632577A1Safe shared-memory communication
Publication Date: 2025.10.15 APEX AI INC
  • EP4632577A1 patent drawingFigure 1A
  • EP4632577A1 patent drawingFigure 1B
  • EP4632577A1 patent drawingFigure 1C

AI summary

Embodiments are directed to safe shared-memory communication between processes. In an embodiment, a data structure for communicating data references, to data in a shared memory, from a sender to a receiver, free from interference, is generated and maintained. The data structure may comprise a queue of the data references that is both readable and writable by the sender and only readable by the receiver, a write index that indicates a write position within the queue, wherein the write index is both readable and writable by the sender and only readable by the receiver, and a read index that indicates a read position within the queue, wherein the read index is only readable by the sender and both readable and writable by the receiver. In addition, read and write operations from and to the queue may utilize plausibility checks to detect and resolve potential corruption of the data structure.