State-Based Queue Protocol for Lock-Free Ring Buffer

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional queue management techniques are sub-optimal in high-performance computing environments, leading to significant performance issues due to record locking schemes that take time to establish and predict, causing inefficiencies and wait/retry processes among competing threads.

Innovation Solution

A state-based queue protocol using atomic operations to change the record header, allowing threads to determine the state of records and update them without collisions, enabling lock-free access and minimizing wait operations by advancing to next-available records.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If record locking schemes are used to ensure proper queue management, then data integrity is maintained, but processing time increases significantly due to lock establishment and waiting

Engineering Contradiction:
Improvedata integrityVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts the locking mechanism entirely from the queue access protocol. Instead of using traditional locks to ensure data integrity, the system uses a lock-free ring buffer where each record contains state bits that atomically indicate availability. This removes the time-consuming lock establishment and waiting processes while maintaining reliability through atomic state transitions.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the mechanical locking system with an atomic state-based system. Rather than acquiring and releasing locks on records, threads perform atomic read-modify-write operations on state bits within record headers. This substitution eliminates the overhead of lock management while preserving data integrity through atomic operations that prevent race conditions.

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

2Ease of operation

If traditional record locking is implemented, then queue access is controlled, but system performance deteriorates due to wait/retry processes among competing threads

Engineering Contradiction:
Improvequeue access controlVSAvoidsystem performance
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The patent implements a self-service mechanism where each thread independently determines record availability by checking state bits and autonomously transitions records to/from available states through atomic operations. This eliminates the need for threads to wait for or negotiate with locks held by other threads, thereby maintaining ease of access control while dramatically improving system performance by removing wait/retry cycles.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent performs preliminary actions by pre-establishing atomic state bits in each record header that indicate availability before any access attempt. Threads check these pre-existing state bits to determine if records are available, eliminating the need for preliminary lock acquisition. This preliminary state preparation enables immediate access decisions without performance-penalizing wait processes.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If locks are used to reserve queue locations, then concurrent access is managed, but it becomes unclear how long records are reserved, causing inefficiencies in lock checking

Engineering Contradiction:
Improveconcurrent access managementVSAvoidlock duration information
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent uses state bits in record headers as visual indicators (analogous to color changes) that immediately show the availability status of each record. Threads can instantly determine if a record is available by checking the state bit value, eliminating the need to infer or track lock duration. This state indication mechanism provides complete information about record status without losing time-related information, as the state itself encodes availability rather than requiring separate timing tracking.

Inventive Principle:
Principle #32Color changes

Data Source

PatentUS11714801B2State-based queue protocol
Publication Date: 2023.08.01 TARGET BRANDS INC
  • US11714801B2 patent drawing
  • US11714801B2 patent drawing
  • US11714801B2 patent drawing

AI summary

Methods and systems for execution of data operations in a queue are described. One method includes loading a pointer to a record in a lock-free ring buffer by an executing thread, as well as calculating an index from the pointer to a record to be processed and obtaining a header of the record to be processed. Based on the header, a state of the record to be processed is determined from among: a filled state, a filling state, a drained state, and a draining state. A candidate header is created which includes an updated state indicating that the record is in use by the executing thread. An atomic operation is performed to update the header of the record to the candidate header. Upon successful completion of the atomic operation to update the header of the record to the candidate header, a data operation is performed on the record.