Shared FIFO Queue Architecture for Lock-Free Reader Aging
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing shared memory systems lack efficient mechanisms for lock-free, concurrent access by writer and reader processes, particularly in network devices where the order of information processing is critical, and consumer-based aging is desired over producer-based aging.
Innovation Solution
A shared memory-based FIFO queue architecture allows concurrent access by a writer process and one or more reader processes, where the writer manages aging queue entries based on reader dequeuing, using monotonically increasing sequence numbers to identify and age out old entries, and maintains persistent state information across process restarts.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional shared memory systems are used, then processes can share data, but they require locking mechanisms that reduce concurrency and efficiency
Solution Approach 1:
The patent introduces a shared memory data structure with sequence numbers as an intermediary mechanism that mediates access between writer and reader processes. Instead of using traditional locking mechanisms, the system uses sequence numbers to coordinate access, allowing multiple readers to concurrently read while the writer writes, thereby eliminating the need for locks and improving concurrency efficiency
Solution Approach 2:
The patent replaces the mechanical locking system with a software-based sequence number tracking system. The writer process maintains a sequence number that increments with each write operation, and reader processes use this sequence number to determine whether data is current, substituting the need for physical or software locks with a simpler counter-based mechanism
2Reliability
If queue entries are aged out based on producer timing, then memory is freed earlier, but consumer-based aging is required to maintain data integrity
Solution Approach 1:
The patent implements feedback by having reader processes monitor the sequence numbers of queue entries and provide information back to the writer process about which entries have been consumed. The writer process uses this feedback to determine when it is safe to age out queue entries, ensuring that entries are only removed after all readers have finished processing them, thus maintaining data integrity while enabling timely memory reclamation
Data Source
AI summary
The present disclosure is directed to a shared first-in-first-out (FIFO) queue architecture in a computing device, such as a network device, that allows lock-free, concurrent access to a writer process (writer) and one or more reader processes (readers). The writer enqueues information provided to the computing device. One or more readers dequeue the information and process the information. A queue manager provides an interface to the shared queue to allow the writer to push data onto the queue and readers to access the queue; e.g., peek and pop the queue. The readers inform the writer when they perform dequeue operations so that the writer knows when to age out queue entries for deletion from the queue.


