Lock-Free Buffer Memory Data Structure for Multi-Producer Consumer Systems

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multi-producer multi-consumer systems, especially in high-safety domains like semi-autonomous driving, existing buffer memories are limited by their fixed capacity and prone to deadlocks when processes terminate abnormally, requiring a thread-safe and dynamically adaptable solution to manage data transfer efficiently.

Innovation Solution

A lock-free buffer memory data structure with multiple queues (first, second, and third queues) that manage unique identifiers for slots, allowing capacity adaptation during operation without dynamic memory usage, using integer values to represent identifiers and cycles, and supporting lock-free, atomic operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locks are used to ensure thread safety in buffer memory, then thread safety is improved, but the risk of deadlock increases when processes terminate abnormally

Engineering Contradiction:
Improvethread safetyVSAvoiddeadlock risk
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent extracts the locking mechanism entirely from the buffer memory access operations. Instead of using locks to protect shared data structures, the invention uses lock-free data structures with atomic operations (compare-and-swap) to ensure thread safety, thereby eliminating the deadlock risk associated with abnormal process termination while holding locks.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the mechanical locking system with an atomic operation-based synchronization mechanism. The compare-and-swap atomic instruction provides memory ordering and mutual exclusion without requiring traditional locks, substituting a lock-based mechanical system with an atomic operation-based system that is inherently more resilient to abnormal termination.

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

2Reliability

If buffer memory capacity is fixed at compilation time, then safety is improved by avoiding dynamic memory usage, but adaptability to changing runtime requirements deteriorates

Engineering Contradiction:
ImprovesafetyVSAvoidcapacity adaptability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic capacity adjustment through a control queue that manages the allocation and deallocation of buffer slots at runtime. The buffer memory capacity can be dynamically increased or decreased by adding or removing slots based on runtime requirements, while maintaining safety through the lock-free atomic operations that protect all capacity modification operations.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent creates a universal buffer memory structure that can adapt to different capacity requirements through the control queue mechanism. The same buffer memory structure serves multiple functions: it maintains fixed-capacity safety guarantees while simultaneously providing dynamic adaptability through controlled slot allocation and deallocation, making it universally applicable to various runtime scenarios.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Adaptability or versatility

If multiple queues are used to manage slot identifiers, then capacity adaptation is improved, but device complexity increases

Engineering Contradiction:
Improvecapacity adaptabilityVSAvoiddata structure complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the buffer memory management into distinct functional queues: a control queue for managing slot identifier allocation and deallocation, and the main buffer queue for data storage. This segmentation allows independent management of capacity adaptation (through the control queue) and data storage (through the buffer queue), reducing overall complexity by separating concerns while maintaining adaptability.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20240004733A1Data structure for a buffer memory in a multi-producer multi-consumer system
Publication Date: 2024.01.04 ROBERT BOSCH GMBH
  • US20240004733A1 patent drawing
  • US20240004733A1 patent drawing
  • US20240004733A1 patent drawing

AI summary

A data structure for a buffer memory for a multi-producer multi-consumer system. The data structure includes at least one slot for storing data, a first queue, a second queue, a third queue. Each slot of the buffer memory is assigned a unique identifier. At all times, each of the identifiers being assigned either to the first queue or to the second queue or to the third queue.