Compact Scalable Mutual Exclusion Lock for Multi-Threaded Concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing concurrency control techniques in multi-threaded systems face inefficiencies under contention, particularly with queue-based locks like CLH and MCS, which suffer from increased latency and coherence costs due to busy-waiting on central locations, and require complex queue node management.

Innovation Solution

The implementation of compact and scalable mutual exclusion techniques using a single word per thread and one word per lock, with an implicit queue structure that avoids queue nodes, allowing threads to wait on a field associated with their predecessor, and utilizing atomic operations like SWAP and CAS for lock acquisition and release, enabling local spinning and context-free operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If queue-based locks like CLH and MCS are used to provide mutual exclusion, then reliability is improved, but device complexity increases due to queue node management

Engineering Contradiction:
Improvemutual exclusionVSAvoidqueue node management
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts the queue node management complexity from the locking mechanism by using an implicit queue structure where threads are tracked through the tail field and grant fields directly in the lock data structure, eliminating the need for separate queue node allocations and deallocations

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The tail field and grant fields serve multiple functions: they track waiting threads, enable lock acquisition, and facilitate lock release without requiring separate queue management structures, thus reducing overall system complexity while maintaining reliability

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

2Reliability

If queue-based locks with central locations are used, then mutual exclusion is achieved, but loss of time increases due to busy-waiting latency

Engineering Contradiction:
Improvemutual exclusionVSAvoidbusy-waiting latency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the waiting mechanism by allowing each thread to wait on a field associated with its specific predecessor thread rather than all threads busy-waiting on a central location, thereby reducing unnecessary waiting time while maintaining mutual exclusion

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements preliminary action by having threads check the tail field and grant fields before entering busy-wait loops, allowing them to determine early whether the lock is available or if they can proceed directly, thus reducing overall waiting latency

Inventive Principle:
Principle #10Preliminary action

3Reliability

If queue-based locks are implemented, then mutual exclusion is provided, but use of energy increases due to coherence costs from central location busy-waiting

Engineering Contradiction:
Improvemutual exclusionVSAvoidcoherence costs
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent segments the coherence traffic by having threads wait on predecessor-specific fields rather than a central location, thereby reducing the frequency and scope of cache coherence operations and lowering energy consumption while maintaining mutual exclusion

Inventive Principle:
Principle #1Segmentation

4Productivity

If compact and scalable mutual exclusion techniques are used, then productivity is improved through high throughput and low latency, but device complexity changes by reducing queue node management structures

Engineering Contradiction:
Improvethroughput and latencyVSAvoidqueue node management
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent extracts and eliminates the queue node management structures from the system, using instead an implicit queue implemented through the tail field and grant fields in the lock data structure, thereby reducing device complexity while improving productivity through faster lock acquisition and release

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent changes the structural parameters of the locking mechanism by using fixed-size tail and grant fields instead of dynamic queue nodes, reducing memory allocation overhead and improving throughput while maintaining the necessary functionality for mutual exclusion

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12124876B2System and method for acquiring and releasing a lock using compact and scalable mutual exclusion
Publication Date: 2024.10.22 ORACLE INT CORP
  • US12124876B2 patent drawing
  • US12124876B2 patent drawing
  • US12124876B2 patent drawing

AI summary

Compact and scalable mutual exclusion techniques are implemented for multiple executing threads. A thread may acquire a lock by swapping a pointer to the thread into a tail field of a lock data structure. If the swap operation returned a null value, then the lock is acquired. If the swap operation does not return a null value, then the thread may wait to obtain the lock from a predecessor thread. The thread may wait until a grant field in a data structure for the predecessor thread stores a pointer to the lock, signaling to the thread that the thread may acquire the lock.