NUMA Lock Access Using Thread Replacement to Cut Contention
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for accessing critical resources in multi-core processors, particularly in ARM architecture, result in excessive operations for lock contention, leading to high resource consumption and reduced performance due to the low single-core processing speed and large number of simultaneous threads.
Innovation Solution
A method where a single thread contends for a lock and executes multiple tasks, replacing other threads to reduce lock contention operations, using techniques like thread blocking and unblocking, and optimizing lock selection in NUMA systems.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multiple threads contend for locks to access critical resources in a multi-core processor, then thread safety and resource protection are ensured, but the number of lock contention operations increases, consuming excessive computing resources and reducing system performance
Solution Approach 1:
The patent merges multiple threads into a single thread to execute multiple tasks that would otherwise require separate lock acquisitions. By consolidating task execution into one thread, the system performs only one lock contention operation instead of multiple operations, reducing overhead while maintaining thread safety through proper lock management.
Solution Approach 2:
The patent makes a single thread universal by enabling it to execute multiple different tasks that previously required separate threads. This multi-functional thread approach allows the system to handle diverse operations while minimizing lock contention, as the single thread manages all tasks sequentially with proper synchronization.
2Adaptability or versatility
If each thread executes its own task independently with individual lock contention, then task execution autonomy is maintained, but the quantity of lock contention operations increases, leading to high resource consumption
Solution Approach 1:
The patent combines multiple independent task executions into a single thread's workflow. Instead of each thread independently acquiring locks for their respective tasks, one consolidated thread executes multiple tasks sequentially, performing lock operations only when necessary and reducing overall computational overhead.
3Productivity
If a single thread executes multiple tasks by replacing other threads, then the number of lock contention operations is reduced, but thread management complexity increases
Solution Approach 1:
The patent introduces a thread management mechanism that acts as an intermediary between multiple tasks and the single executing thread. This mediator handles task scheduling, thread replacement, and state management, abstracting the complexity of managing multiple tasks in one thread while maintaining efficient lock contention through centralized control.
Data Source
AI summary
A method and an apparatus for accessing a critical resource, a computer device, and a readable storage medium are provided, to help reduce a quantity of operations for contending for a lock by a thread, and computing resources, and improve performance of an ARM processor. The method for accessing a critical resource includes: selecting a first thread from the first thread and a second thread to contend for a target lock (201), where a first task to be executed by the first thread and a second task to be executed by the second thread correspond to the target lock; and if the first thread obtains the target lock through contention, enabling the first thread to execute the first task, and replace the second thread to execute the second task (202).


