Non-blocking Queue Thread Identification for Multi-thread Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In multi-thread processing environments, threads often enter a busy-wait state when accessing shared memory queues, leading to inefficient CPU resource utilization due to the need for exclusive control mechanisms and lengthy procedures to ensure data consistency, resulting in decreased processing efficiency.
Innovation Solution
An information processing apparatus and method that employs a non-blocking queue structure using linked lists and atomic operations to manage thread access, allowing threads to place identification information in the queue when data is unavailable, enabling immediate release of the processor and resuming operations without locking, thus reducing waiting times and improving efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a queue storage mechanism is used to manage thread access to shared data, then data consistency is ensured, but processing efficiency deteriorates due to busy-wait states and exclusive control overhead
Solution Approach 1:
The patent extracts the thread identification information from the traditional queue data structure and stores it separately in a dedicated field within the queue storage. This allows the queue to maintain data consistency through proper tracking of waiting threads while enabling the processing thread to efficiently check and clear the waiting thread information, thereby reducing busy-wait overhead and improving processing efficiency
Solution Approach 2:
The patent introduces an intermediary mechanism where the queue storage acts as a mediator between the processing thread and the data generation thread. By storing thread identification information in the queue, the system enables indirect communication and coordination between threads without requiring continuous exclusive control, thus maintaining data consistency while reducing processing delays
2Reliability
If exclusive control mechanisms are implemented to ensure queue data consistency, then data integrity is maintained, but access procedures become lengthy and complex
Solution Approach 1:
The patent segments the queue storage structure into distinct functional fields: one for storing data elements and another for storing thread identification information. This segmentation allows the system to maintain data consistency through structured organization while simplifying access procedures, as threads can directly interact with their identification fields without complex locking mechanisms
Solution Approach 2:
The patent implements a self-service mechanism where the queue storage automatically manages thread identification information. When a thread waits for data, its identification is automatically recorded in the queue; when data becomes available, the processing thread can automatically retrieve and clear the waiting thread information. This self-managing approach maintains data consistency while eliminating the need for complex external control procedures
Data Source
AI summary
For a thread where data is to be popped off of queue storage, whether or not there is data that can be popped out of the queue storage accessed is first checked and then the data, if any, is popped. When there is no such data, the thread pushes thread information, including the identification information of its own thread, on the same queue and then releases a processor and shifts to a standby state. For a thread that is to push the data, when there is the thread information in the queue, it is determined that there is a thread waiting for the data, and then the data is sent after the thread information has been popped, which in turn resumes the processing.


