Lockless Open Collection Data Structure for Parallel Transaction Processing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In data systems that perform transactions in parallel, the interleaving of task entries from different transactions complicates the processing and completion order, leading to inefficiencies and the need for complex locking mechanisms to manage concurrent access.

Innovation Solution

A lockless open collection data structure is used to create a sequence of collection records, allowing for parallel processing by expanding collection definitions dynamically and creating records based on state changes, eliminating the need for locking structures.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locking mechanisms are used to manage concurrent access to collection data structures, then data consistency is maintained, but processing throughput decreases due to serialization overhead

Engineering Contradiction:
Improvedata consistencyVSAvoidprocessing throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The collection data structure is segmented into multiple independent slots or buckets, allowing different threads to access and modify different slots simultaneously without requiring global locks. This segmentation enables parallel access while maintaining data consistency within each slot through versioning or tagging mechanisms.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

An intermediary data structure or buffer is introduced between the parallel processing threads and the final collection output. This intermediary allows threads to add elements concurrently without direct contention, and then a separate consolidation phase merges the results, eliminating the need for locking during the high-frequency insertion phase.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If complex locking structures are implemented to handle interleaved task entries, then transaction integrity is preserved, but system complexity increases

Engineering Contradiction:
Improvetransaction integrityVSAvoidlocking mechanism complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The data structure incorporates self-service mechanisms such as embedded version counters, generation numbers, or conflict detection tags within each element. When concurrent access occurs, the structure automatically detects conflicts through these self-contained markers and resolves them using predefined rules, eliminating the need for external locking logic and reducing overall system complexity.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

Instead of directly modifying the shared collection structure under locks, threads create local copies or snapshots of the data, perform modifications independently, and then atomically publish the changes. This copying approach preserves transaction integrity through atomic publish operations while avoiding complex locking mechanisms during the modification phase.

Inventive Principle:
Principle #26Copying

3Loss of information

If collection definitions are expanded dynamically to include all data items, then data completeness is achieved, but processing time increases due to continuous evaluation

Engineering Contradiction:
Improvedata completenessVSAvoidprocessing time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-defining collection templates or schemas with expected data types and structures before processing begins. During parallel processing, threads validate elements against these pre-defined templates rather than dynamically expanding collection definitions, which completes data validation efficiently while maintaining data completeness through the comprehensive template coverage.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Collection definition expansion is performed periodically or at discrete checkpoints rather than continuously during data processing. Threads add elements to collections based on pre-established criteria, and the collection definitions are refreshed or expanded at periodic intervals, reducing processing overhead while ensuring data completeness through regular updates.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS10102251B2Lockless open collection data structure
Publication Date: 2018.10.16 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10102251B2 patent drawing
  • US10102251B2 patent drawing
  • US10102251B2 patent drawing

AI summary

A lockless open collection data structure used to create a sequence of collection records. The sequence of collection records may be inserted into a data stream for purposes of assisting in subsequent processing of the data stream in a parallel manner, by collection. The open collection data structure is re-usable for multiple collections of data items within the data stream. The use of the open collection data structure may occur while a data stream that includes multiple different types of data items is being evaluated. The open collection data structure is used to track an expandable collection definition of a currently open collection. Upon detecting that the collection definition is no longer expandable, the collection record is created based on state within the open collection data structure. Once the collection record for a collection has been created, the open collection data structure becomes available for the next collection record.