Lock-Free Memory Buffer for Point-to-Multipoint Data Transport
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
High-performance network communication systems face performance degradation due to intensive use of mutexes for thread synchronization, leading to wait states and increased kernel calls, particularly in multi-threaded data transport protocols like UDT and TCP, which struggle with shared memory access in point-to-multipoint data transmission.
Innovation Solution
A lock-free meta-storage organization with ActiveCellsBeginDescr and ActiveCellsEndDescr descriptors, along with a binary mask for acknowledging receivers, allows concurrent memory access without locks, decoupling meta-data handling from the receive handler thread and enabling asynchronous ARQ processing, reducing load on the receiving thread and improving network communication stack performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If mutexes are used for thread synchronization in multi-threaded data transport protocols, then thread-safe access to shared memory is ensured, but system performance deteriorates due to wait states and increased kernel calls
Solution Approach 1:
The shared send buffer is divided into multiple independent cell structures, each representing a separate data packet unit. Each cell contains its own metadata (sequence number, length, position) and can be independently accessed by different threads. This segmentation eliminates the need for global locking mechanisms while maintaining thread safety through atomic operations on individual cell pointers and counters.
Solution Approach 2:
The patent introduces a lock-free data structure with explicit pointer fields (write pointer, read pointer, next free cell) that act as intermediaries between competing threads. These intermediary pointers coordinate access to the shared buffer without requiring mutex locks, using compare-and-swap (CAS) atomic operations to resolve concurrent access conflicts efficiently at the hardware level rather than through kernel-mediated locking.
2Stability of the object's composition
If traditional locking mechanisms are used for buffer access, then data consistency is maintained, but communication software stack performance decreases rapidly
Solution Approach 1:
The buffer data structure is designed to be self-protecting through its lock-free implementation. The atomic pointer manipulations and CAS operations embedded in the data structure itself provide automatic synchronization without external locking mechanisms. Threads can independently and concurrently update buffer state through these self-service atomic operations, maintaining consistency without performance-penalty-inducing locks.
Solution Approach 2:
The patent replaces the mechanical locking system (mutexes and semaphores that require kernel intervention and context switching) with hardware-level atomic memory operations. This substitution eliminates the overhead of system calls and kernel mode transitions, achieving data consistency through processor-supported atomic instructions that operate directly in user space with minimal performance overhead.
3Reliability
If mutexes or semaphores are applied for simultaneous buffer access, then race conditions are prevented, but the number of necessary Kernel system calls increases rapidly
Solution Approach 1:
The patent replaces the complex mechanical locking system involving multiple kernel system calls with simple hardware atomic operations. The lock-free buffer uses atomic compare-and-swap instructions that prevent race conditions through memory-ordering guarantees provided by the processor, eliminating the need for kernel-mediated synchronization and dramatically reducing system call overhead.
4Productivity
If lock-free data structures are used for high-speed data transport, then thread synchronization overhead is eliminated, but implementation complexity increases for point-to-multipoint protocols
Solution Approach 1:
The buffer is segmented into independent cell units with explicit pointer fields that can be individually manipulated. This segmentation simplifies the lock-free implementation by allowing threads to operate on discrete cells rather than managing complex global buffer state, reducing the implementation complexity while maintaining high synchronization efficiency.
Data Source
Figure 1~3
Figure 4~5
Figure 6
AI summary
The invention relates to a method for operating a memory buffer system for the fast data transport over a communication network (30) with a reliable transport protocol working in a point-to-multipoint data transfer mode in a multi-thread environment. The invention proposes a novel meta-storage in-memory organization, which enables that concurrent memory accesses could be guaranteed without using locks, such as mutexes or semaphores. The meta-storage organization involves the use of ActiveCellsBeginDescr- and Active CellsEndDescr-descriptors and the addition of mask information (MASK) for each cell reflecting for the receiving stations (21, 22, 23) of a data transfer session in the point-to-multipoint mode, the state whether or not an acknowledgment message has been received back from the respective receiving station (21, 22, 23) for the corresponding data packet being sent over the communication network (30). The invention also proposes an enhanced ACK ARQ loss report method.