Inter-Process Messaging via Shared Circular Buffer
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing inter-process messaging techniques often suffer from delays due to synchronization issues, where senders must wait for receivers to be ready, and require complex schemes to ensure correct sequencing of data exchanges, leading to inefficiencies in data transmission.
Innovation Solution
The implementation of a shared circular buffer for inter-process messaging, allowing senders to write messages directly to shared memory without waiting for receivers, using a two-phase approach for message sending and receiving, and employing zero-copy semantics to reduce overhead and eliminate the need for mutual exclusion.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional named pipes with synchronization schemes are used for inter-process messaging, then data exchange correctness is ensured, but transmission delays occur due to sender waiting for receiver readiness
Solution Approach 1:
The patent implements a circular buffer that pre-allocates memory space for multiple messages before transmission. Senders can write messages to the buffer in advance without waiting for receiver readiness, as the buffer structure and synchronization mechanisms (sequence numbers, flags) are prepared beforehand. This eliminates transmission delays while ensuring correctness through pre-established synchronization protocols.
2Reliability
If complex synchronization schemes are implemented to ensure correct sequencing, then data exchange reliability is improved, but system complexity increases
Solution Approach 1:
The patent segments the messaging system into distinct components: a circular buffer for message storage, sequence numbers for ordering, and control flags for synchronization state. Each component has a specific, simplified function. The buffer handles storage, sequence numbers handle ordering, and flags handle synchronization coordination. This segmentation reduces overall system complexity compared to monolithic synchronization schemes.
Solution Approach 2:
The patent introduces a circular buffer as an intermediary between sender and receiver processes. This buffer acts as a mediator that decouples the sender and receiver, allowing them to operate independently without direct synchronization. The buffer absorbs timing differences and coordination overhead, simplifying the interaction model while maintaining sequencing correctness through embedded sequence numbers and control flags.
3Reliability
If senders wait for receiver readiness before writing messages, then synchronization is maintained, but throughput and productivity decrease
Solution Approach 1:
The patent enables continuous message writing by senders to the circular buffer without interruption or waiting for receiver readiness. The buffer structure allows multiple messages to be queued continuously, and the receiver can consume messages at its own pace. This continuous writing capability significantly improves throughput while synchronization is maintained through sequence numbers and control flags that ensure correct message delivery ordering.
Data Source
AI summary
Provided are systems and methods for a first process for writing messages to a shared memory (each of the messages being written to a respective buffer of the shared memory, and the messages configured to be read in a specified sequence by a second process), determining that writing of one of the messages to the shared memory has been completed and, sending, to the second process and in response to determining that writing of one of the messages to the shared memory has been completed, an offset value corresponding to a location in the shared memory, wherein the second process is configured to read one or more messages that are stored in the portion of the shared memory before the offset value. Also the second process reads one or more messages stored in buffers that reside in the portion of the shared memory before the offset value, and commits the reads.


