Shared-Memory Communication with Access-Controlled Queues
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing shared-memory communication systems face challenges in ensuring freedom from interference and data integrity, particularly in multi-threaded environments, due to the use of mutexes, unsafe buffer ownership transfer, and unprotected control data, which can lead to data corruption and system failures.
Innovation Solution
Implementing lock-free data structures with defined access rights and plausibility checks to manage memory region ownership, using separate components with different access rights and redundant copies to ensure data integrity and prevent interference.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If mutexes are used to prevent data races in shared memory communication, then data integrity is improved, but blocking and deadlocks occur reducing system reliability
Solution Approach 1:
The patent extracts the locking mechanism entirely from the shared memory communication system. Instead of using mutexes to protect access to shared data structures, the invention uses lock-free algorithms with atomic operations (compare-and-swap) to ensure thread safety. This eliminates the blocking behavior and deadlock potential while maintaining data integrity through atomicity guarantees.
Solution Approach 2:
The patent replaces the mechanical locking system (mutexes that physically block thread execution) with a software-based atomic operation system. The compare-and-swap instruction provides a hardware-supported atomic mechanism that doesn't require thread blocking, substituting the mechanical contention-based approach with an instruction-level atomic approach that maintains progress.
2Productivity
If unsafe buffer ownership transfer is implemented for performance, then communication speed is improved, but data corruption risks increase
Solution Approach 1:
The patent introduces an intermediary mechanism in the form of a reference-counted buffer management system. Buffers are not directly transferred between processes without protection; instead, a shared control structure with atomic reference counting mediates the transfer. This allows zero-copy performance while ensuring that buffer ownership transitions are properly tracked and validated through atomic operations.
Solution Approach 2:
The patent uses copying of reference information rather than direct manipulation of buffer pointers. Instead of unsafe pointer transfers, the system copies and validates buffer metadata (descriptors, reference counts) through atomic operations, creating a safe abstraction layer that maintains the performance benefits of zero-copy data transfer while ensuring integrity.
3Ease of operation
If unprotected control data is used in shared memory, then access complexity is reduced, but data corruption and interference occur
Solution Approach 1:
The patent segments the shared memory control data into distinct atomic fields (reference counts, ownership flags, buffer descriptors). Each field is protected by its own atomic operations, allowing simple individual access patterns while ensuring overall consistency. This segmentation enables processes to access specific control data elements without needing complex locking protocols, maintaining simplicity while preventing corruption.
Data Source
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.


