Message Transmitting Queue with Flag-Based Coordination
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In multi-threaded systems, message misplacement or overlap occurs when using general serial queues due to the size of transmitted messages exceeding atomic data read/write size, leading to inefficiencies and performance issues, which are compounded by the need for complex software semaphores to prevent these problems.
Innovation Solution
A buffer device with a message transmitting queue that includes multiple message rows, each with write and distribution complete flags, a write control unit, and a read control unit, which manages message storage and retrieval to prevent misplacement and overlap without using semaphores, by sequentially outputting free message row addresses and issuing read requests based on complete flags.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If a general serial queue with only write pointer and read pointer is used, then the structure is simple, but message misplacement or overlap occurs in multi-threaded systems
Solution Approach 1:
The patent divides the message transmission process into distinct phases by segmenting the queue structure into multiple message rows, each with independent write complete flags and distribution complete flags. This segmentation allows multiple threads to operate on different message rows simultaneously without interference, preventing message misplacement and overlap while maintaining structural clarity.
Solution Approach 2:
The patent introduces complete flags as intermediary elements between the write pointer/read pointer and the actual message data. These flags act as mediators that coordinate the writing and reading operations, ensuring that a message is fully written before being marked for distribution and preventing overlap between concurrent threads without requiring complex semaphore mechanisms.
2Reliability
If semaphore is used to prevent message overlap, then message transmission reliability is improved, but software operation complexity increases and system performance is impacted
Solution Approach 1:
The patent implements self-service by allowing the queue structure itself to manage thread coordination through its built-in complete flags. The write complete flags automatically signal when a message is fully written, and the distribution complete flags coordinate reading operations, eliminating the need for external semaphore mechanisms and reducing software operational complexity.
Solution Approach 2:
The patent extracts the coordination function from complex software semaphore operations and embeds it directly into the queue hardware structure through complete flags. This extraction simplifies software operations by removing the need for manual semaphore manipulation while maintaining reliable message transmission through the flag-based coordination mechanism.
3Reliability
If the write pointer cannot move until message writing completes, then data integrity is maintained, but system throughput is reduced in multi-threaded environments
Solution Approach 1:
The patent applies dynamics by making the write pointer movement conditional rather than blocking. The write pointer can advance to the next message row as long as the current message row's write complete flag is set, allowing overlapping operations between threads. This dynamic approach maintains data integrity through flag verification while significantly improving throughput by eliminating unnecessary blocking.
Solution Approach 2:
The patent implements preliminary action by setting the write complete flag before the write pointer moves to the next message row. This preliminary flag setting allows the write pointer to advance proactively without waiting for the actual read operation to complete, enabling overlapping write and read operations across different message rows and improving system throughput while maintaining data integrity.
Data Source
AI summary
A message transmitting queue delivers messages between a source controller and a destination controller. According to the message transmitting request of the source controller, sequentially distribute the free message row of the message transmitting queue, and set the message row to the distributed state. After the source controller writes the message of the message row, set the message row to the written state. At this moment, when the message row is in the position that is read sequentially by the destination controller, a read request is issued, so that the destination controller reads the message according to the read request when the reading completes, clears the distributed signal and the written signal, so that the message row goes back to the free state. When the message transmitting queue has no free message row, a no free message row signal to inform the source controller is issued.


