Lock-free Circular Buffer Sharing via Dirty Region Prediction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional systems face challenges in providing concurrent read access to circular buffers, especially as the number of reading systems increases, leading to prolonged lock times and potential system failures due to unreleased buffer locks, which hinder continuous recording and data availability.

Innovation Solution

Implement a lock-free sharing method for circular buffers by using shared metadata to compute a predicted write pointer location and a dirty region, allowing consumer systems to read from a stable region without relying on buffer locks, enabling continuous access and recording even with multiple consumer systems.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Stability of the object's composition

If buffer locks are used to ensure stable read access, then reading stability is improved, but system scalability and continuous recording deteriorate due to prolonged lock times

Engineering Contradiction:
Improvereading stabilityVSAvoidcontinuous recording
Core Design Contradiction:
Stability of the object's compositionVSProductivity

Solution Approach 1:

The circular buffer is segmented into a dirty region (where data is being written) and a clean region (where data is stable for reading). By dividing the buffer into these functional zones, the system allows readers to access the clean region without acquiring locks, while writers continue to operate in the dirty region, thus maintaining both reading stability and continuous recording.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Different regions of the circular buffer are assigned different quality characteristics: the dirty region tolerates changing data during writes, while the clean region guarantees stable data for reads. This local differentiation allows concurrent access without locks by ensuring readers only access regions with the appropriate stability guarantee.

Inventive Principle:
Principle #3Local quality

2Reliability

If buffer locks are used to prevent data corruption, then data integrity is improved, but system scalability deteriorates as more consumer systems are added

Engineering Contradiction:
Improvedata integrityVSAvoidsystem scalability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The system performs preliminary actions by maintaining a clean region that is already validated and stable before readers need to access it. This advance preparation of readable data eliminates the need for locks during read operations, allowing multiple consumer systems to access data simultaneously without compromising data integrity or limiting scalability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The dirty/clean region boundary acts as an intermediary mechanism that mediates between writers and readers. Instead of using locks as the intermediary, the boundary region classification provides a lock-free way to coordinate access, allowing multiple consumers to scale while maintaining data integrity through regional validation.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Stability of the object's composition

If buffer locks are used to ensure stable read environment, then read stability is improved, but time efficiency deteriorates due to lock acquisition and release overhead

Engineering Contradiction:
Improveread stabilityVSAvoidlock overhead time
Core Design Contradiction:
Stability of the object's compositionVSLoss of time

Solution Approach 1:

The locking mechanism is extracted and replaced with a regional validation approach. Instead of extracting individual lock operations, the system extracts the stability guarantee and embeds it in the clean region designation, allowing readers to access stable data without the time overhead of lock acquisition and release.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The circular buffer structure itself provides the stability guarantee through its regional organization, eliminating the need for external lock management. The clean region inherently serves the read stability requirement without requiring additional control mechanisms, thus eliminating lock overhead time while maintaining read stability.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11650923B2Lock-free sharing of live-recorded circular buffer resources
Publication Date: 2023.05.16 SLING MEDIA PVT LTD
  • US11650923B2 patent drawing
  • US11650923B2 patent drawing
  • US11650923B2 patent drawing

AI summary

Novel techniques are described for lock-free sharing of a circular buffer. Embodiments can provide shared, lock-free, constant-bitrate access by multiple consumer systems to a live stream of audiovisual information being recorded to a circular buffer by a producer. For example, when a producer system writes a data stream to the circular buffer, the producer system records shared metadata. When a consumer system desires to begin reading from the shared buffer at a particular time, the shared metadata is used to compute a predicted write pointer location and corresponding dirty region around the write pointer at the desired read time. A read pointer of the consumer system can be set to avoid the dirty region, thereby permitting read access to a stable region of the circular buffer without relying on a buffer lock.