Segmented Global Variable Access for High-Concurrency CAS Control
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The increasing number of computer cores and thread concurrency leads to a high failure rate and exponential overheads in CAS operations, particularly in high-concurrency scenarios, resulting in a bottleneck that hampers computer performance.
Innovation Solution
Divide a global variable controlling thread access into multiple variable sub-areas, group threads into corresponding sub-groups, and allow only one thread per group to modify a flag bit in each sub-area, ensuring independent modifications and reducing conflicts.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If multiple threads concurrently perform CAS operations on a single global variable, then thread concurrency is supported, but the failure rate of CAS operations increases and overheads increase exponentially
Solution Approach 1:
The patent divides the global variable into multiple variable sub-areas, where each sub-area can be independently modified by threads in corresponding thread groups. This segmentation allows multiple threads to successfully perform CAS operations simultaneously on different sub-areas, thereby reducing the failure rate and overheads while maintaining support for high thread concurrency.
2Ease of operation
If multiple threads concurrently modify a global variable, then thread access control is implemented, but modification success rate decreases and resource waste increases
Solution Approach 1:
The global variable is segmented into multiple variable sub-areas, and threads are grouped into multiple thread groups with each group corresponding to a specific sub-area. Threads within a group can independently modify their designated sub-area without interfering with other groups, thereby maintaining access control while significantly improving modification success rate and reducing resource waste.
Solution Approach 2:
Different thread groups are authorized to modify specific variable sub-areas, creating a local quality distribution where each group has exclusive or preferential access to its designated sub-area. This local authorization reduces conflicts between threads and improves overall modification success rate.
Data Source
AI summary
A multi-thread concurrency management method includes dividing a target global variable into multiple variable sub-areas, where the target global variable is used to control multiple threads to access target data, and each variable sub-area in the multiple variable sub-areas includes one or more flag bits; grouping the multiple threads into multiple thread groups, where the multiple threads are used to apply for a permission to read the target data; authorizing a target thread in a target thread group to modify a flag bit in a target variable sub-area, where one thread group in the multiple thread groups one-to-one corresponds to one variable sub-area in the multiple variable sub-areas; and if the target thread successfully modifies the flag bit, allowing the target thread to read the target data.


