Lockless Multi-Producer Single-Consumer FIFO Queue

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Multi-producer/single-consumer FIFO queues in high-performance server applications, such as storage clusters, are CPU-inefficient due to minor contentions on spinlocks and busy-wait overhead, leading to performance degradation in enqueuing and dequeuing operations.

Innovation Solution

A lockless and loopless multi-producer/single-consumer FIFO queue is implemented using a linked list structure with atomic operations, where the tail element points to the last element and the head element points to the first element, allowing for efficient enqueue and dequeue operations without spinlocks or busy-waiting, and using a last element mark to distinguish steady states from race conditions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a multi-producer/single-consumer FIFO queue is implemented using traditional spinlock mechanisms, then queue operations can be synchronized and reliable, but CPU efficiency deteriorates due to spinlock contention and busy-wait overhead

Engineering Contradiction:
Improvequeue operation reliabilityVSAvoidCPU efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent extracts and removes the spinlock mechanism from the queue implementation, replacing it with a lockless design using atomic operations. This eliminates the source of contention while maintaining synchronization through hardware-supported atomic compare-and-swap instructions, thereby removing the busy-wait overhead without sacrificing reliability.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent substitutes the mechanical spinlock-based synchronization system with an atomic operation-based system. Instead of using software spinlocks that cause CPU busy-waiting, the implementation uses hardware atomic instructions (compare-and-swap) that provide lock-free synchronization, replacing the mechanical locking mechanism with a more efficient atomic operation mechanism.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Reliability

If traditional queue implementations are used with spinlocks, then queue operations are synchronized, but performance degradation occurs due to busy-wait overhead

Engineering Contradiction:
ImprovesynchronizationVSAvoidbusy-wait time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts and removes the spinlock mechanism that causes busy-wait overhead, replacing it with a lockless design using atomic operations. This eliminates the source of contention while maintaining synchronization through hardware-supported atomic compare-and-swap instructions, thereby removing the busy-wait overhead without sacrificing reliability.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent enables continuous queue operations without interruption from spinlock acquisition and release cycles. By using atomic compare-and-swap operations, producers can continuously enqueue elements and consumers can continuously dequeue elements without being blocked by spinlock contention, maintaining continuous useful action instead of alternating between useful work and busy-waiting.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS11809835B2System and method for efficient queue management
Publication Date: 2023.11.07 EMC IP HLDG CO LLC
  • US11809835B2 patent drawing
  • US11809835B2 patent drawing
  • US11809835B2 patent drawing

AI summary

A method, computer program product, and computing system for defining a queue. The queue may be based on a linked list and may be a first-in, first-out (FIFO) queue that may be configured to be use used with multiple producers and a single consumer. The queue may include a plurality of queue elements. A tail element and a head element may be defined from the plurality of elements within the queue. The tail element may point to a last element of the plurality of elements and the head element may point to a first element of a plurality of elements. An element may be dequeued from the tail element, which may include determining if the tail element is in a null state. An element may be enqueued to the head element, which may include adding a new element to the queue.