Lock-Free FIFO Queue Elimination Structure

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing concurrent FIFO queue implementations face scalability issues under high loads due to bottlenecks at the head and tail of the queue, and previous lock-free solutions are not linearizable or perform poorly under low loads.

Innovation Solution

A lock-free, linearizable, and scalable FIFO queue implementation using an elimination structure that allows enqueue and dequeue operations to pair up without synchronizing on centralized data, dynamically determining access to a central queue or elimination based on system load, utilizing a collision array for operation pairing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If lock-free FIFO queue implementation uses centralized synchronization at head and tail (MS-queue algorithm), then enqueue and dequeue operations can complete without interfering with each other when queue is nonempty, but as number of concurrent threads increases, head and tail become bottlenecks and performance suffers

Engineering Contradiction:
Improvecorrectness of concurrent operationsVSAvoidperformance under high concurrency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The queue is divided into multiple segments, each with its own head and tail pointers. Multiple threads can operate on different segments simultaneously without centralized synchronization, eliminating the single-point bottleneck while maintaining FIFO semantics through segment ordering.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

An intermediary elimination structure is introduced that allows enqueue and dequeue operations to pair up and eliminate each other without directly synchronizing on centralized head/tail data. This intermediary mechanism enables operations to complete independently while maintaining correctness.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If elimination technique is used to allow enqueue and dequeue operations to pair up without centralized data synchronization, then scalability is improved, but implementing elimination for FIFO queues is substantially more difficult than for stacks due to ordering requirements

Engineering Contradiction:
Improvescalability under high loadVSAvoidcomplexity of elimination mechanism
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

Enqueue operations preliminarily install entries in the elimination structure before actually adding to the central queue. This preliminary action allows dequeue operations to find and pair with corresponding enqueue operations in the elimination structure, enabling elimination without complex coordination.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The elimination structure maintains copies of enqueue operation information (pointers, values, metadata) separate from the central queue structure. This copying allows dequeue operations to eliminate against the copy without affecting the central queue, simplifying the elimination mechanism while maintaining FIFO semantics.

Inventive Principle:
Principle #26Copying

3Productivity

If dynamic determination of accessing central queue or attempting elimination is implemented based on system load heuristic, then performance is improved across varying loads, but additional overhead is introduced for deciding whether to access queue or eliminate

Engineering Contradiction:
Improveperformance across varying loadsVSAvoidoverhead of load-based decision making
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system automatically monitors its own load conditions and dynamically adjusts operation routing without external intervention. The load heuristic is implemented as a self-service mechanism that threads use to decide whether to access the central queue or attempt elimination, eliminating the need for external load management.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system dynamically changes operational parameters (routing decisions) based on load conditions. When load is low, operations route to the central queue for direct access; when load is high, operations route to the elimination structure. This parameter change optimizes performance across varying loads without requiring system redesign.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS7836228B1Scalable and lock-free first-in-first-out queue implementation
Publication Date: 2010.11.16 ORACLE AMERICAN INC
  • US7836228B1 patent drawing
  • US7836228B1 patent drawing
  • US7836228B1 patent drawing

AI summary

A scalable first-in-first-out queue implementation adjusts to load on a host system. The scalable FIFO queue implementation is lock-free and linearizable, and scales to large numbers of threads. The FIFO queue implementation includes a central queue and an elimination structure for eliminating enqueue-dequeue operation pairs. The elimination mechanism tracks enqueue operations and/or dequeue operations and eliminates without synchronizing on the FIFO queue implementation.