Lock-Free Double-Linked List with Atomic Reference Counters

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional lock-free techniques for double-linked lists are inadequate for handling concurrent access and modifications in multi-threaded environments, particularly when each node is treated as an independent object with multiple handles, leading to issues like deadlocks and race conditions.

Innovation Solution

Implementing lock-free double-linked lists with each node featuring a reference counter and using compare-and-swap atomic operations to manage node insertion and deletion, ensuring thread-safe and scalable operations by combining the reference counter and previous pointer into an atomic structure.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locking techniques such as mutual exclusion are used for insertion and deletion of list items, then thread safety is achieved, but deadlocks and priority inversion occur

Engineering Contradiction:
Improvethread safetyVSAvoiddeadlocks and priority inversion
Core Design Contradiction:
ReliabilityVSObject-generated harmful factors

Solution Approach 1:

The patent extracts the locking mechanism from the list operations and replaces it with a lock-free approach using atomic compare-and-swap operations. Each node contains a pointer-counter combination that is atomically updated, eliminating the need for mutex locks and thereby preventing deadlocks and priority inversion while maintaining thread safety

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent substitutes the mechanical locking system (mutual exclusion) with an atomic hardware-level operation (compare-and-swap). This replacement uses processor-supported atomic instructions to ensure thread safety without the overhead and potential hazards of software-based locking mechanisms

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

2Object-generated harmful factors

If conventional lock-free techniques using compare-and-swap are used, then deadlocks are prevented, but the techniques are insufficient when each node is treated as an independent object with multiple handles

Engineering Contradiction:
Improvedeadlocks preventionVSAvoidhandling of independent nodes with multiple handles
Core Design Contradiction:
Object-generated harmful factorsVSAdaptability or versatility

Solution Approach 1:

The patent merges the pointer and reference counter into a single atomic pointer-counter combination structure. This unified structure allows the compare-and-swap operation to atomically update both the node pointer and the reference counter, enabling proper handling of independent nodes with multiple handles while maintaining lock-free operation

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent creates a universal node structure that can be safely shared across multiple threads and handles. The pointer-counter combination serves multiple functions: it tracks node references, enables atomic updates, and supports independent node manipulation, making the data structure versatile for various concurrent access patterns

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

3Productivity

If reference counters are added to each node for lock-free operations, then concurrency and scalability are enhanced, but node structure complexity increases

Engineering Contradiction:
Improveconcurrency and scalabilityVSAvoidnode structure
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent combines the pointer and reference counter into a single atomic pointer-counter combination, rather than storing them as separate fields. This merging reduces the effective structure complexity while enabling lock-free operations, as the combined structure can be atomically updated in a single operation

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The pointer-counter combination serves multiple purposes: it maintains the linked list structure through the pointer, tracks node references through the counter, and enables atomic updates through the combined structure. This multi-functionality justifies the added complexity by providing comprehensive concurrency support

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

Data Source

PatentUS9639270B2Double-linked lists with reference counters
Publication Date: 2017.05.02 SAP SE
  • US9639270B2 patent drawing
  • US9639270B2 patent drawing
  • US9639270B2 patent drawing

AI summary

A system includes, in a first memory location, a pointer to a next one of the plurality of memory locations and a respective reference counter, in each of respective ones of a plurality of memory locations, a pointer to a next one of the plurality of memory locations, a pointer to a previous one of the plurality of memory locations, and a reference counter, and in a last memory location, a pointer to a previous one of the plurality of memory locations and a respective reference counter, and atomically incrementing and decrementing of a reference counter stored in one of the plurality of memory locations.