Lock Variable Segmentation for Concurrent Critical Section Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computing devices face sub-optimal performance due to unnecessary restrictions on the execution of program code caused by critical sections, where locks prevent concurrent execution of instructions across entities, even when these instructions do not perform externally accessible operations.

Innovation Solution

The implementation of a mechanism where entities can hold a lock variable with a TAKEN_FOR_READING value in a local cache while the lower-level cache holds a FREE value, allowing multiple entities to concurrently execute critical sections protected by the same lock, while maintaining the appearance that they are not executed concurrently by preventing externally accessible operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locks are used to prevent concurrent execution of critical sections, then data coherence and conflict prevention are improved, but execution performance and productivity deteriorate due to unnecessary restrictions

Engineering Contradiction:
Improvedata coherenceVSAvoidexecution performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the lock variable into two separate variables: a first lock variable stored in the lower-level cache and a second lock variable stored in the local cache. This segmentation allows different entities to read from the first lock variable while writing to the second lock variable, enabling concurrent execution without compromising data coherence. The segmentation resolves the contradiction by allowing multiple entities to execute critical sections simultaneously while maintaining the appearance of mutual exclusion through the coordinated use of both lock variables.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements a copy of the lock variable in the local cache (second lock variable) that mirrors the state of the original lock variable in the lower-level cache (first lock variable). This copying mechanism allows entities to hold a local copy with a TAKEN_FOR_READING value while the lower-level cache maintains the FREE value, enabling concurrent execution. The copy is updated only when necessary to maintain consistency, thus improving performance while preserving the reliability of the locking mechanism.

Inventive Principle:
Principle #26Copying

2Reliability

If locks prevent concurrent execution of critical sections, then conflict prevention is improved, but device complexity increases due to additional lock management mechanisms

Engineering Contradiction:
Improveconflict preventionVSAvoidlock management complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent divides the lock management into two independent parts by using separate lock variables in different cache levels. The first lock variable in the lower-level cache maintains the traditional locking semantics for conflict prevention, while the second lock variable in the local cache handles the concurrency control. This segmentation reduces the complexity of the overall lock management mechanism by allowing each variable to serve a specific purpose without requiring complex coordination logic.

Inventive Principle:
Principle #1Segmentation

3Reliability

If critical sections are executed sequentially, then data coherence is maintained, but execution time and loss of time increase

Engineering Contradiction:
Improvedata coherenceVSAvoidexecution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent introduces dynamic behavior to the lock variable management by allowing entities to hold the lock variable with a TAKEN_FOR_READING value in the local cache without immediately updating the lower-level cache. This dynamic approach enables concurrent execution of critical sections while maintaining data coherence through selective updates. The system dynamically adjusts the state of lock variables based on the execution context, allowing multiple entities to execute simultaneously when safe and maintaining sequential execution when necessary to preserve coherence.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS9916189B2Concurrently executing critical sections in program code in a processor
Publication Date: 2018.03.13 ADVANCED MICRO DEVICES INC
  • US9916189B2 patent drawing
  • US9916189B2 patent drawing
  • US9916189B2 patent drawing

AI summary

In the described embodiments, entities in a computing device selectively write specified values to a lock variable in a local cache and one or more lower levels of a memory hierarchy to enable multiple entities to enable the concurrent execution of corresponding critical sections of program code that are protected by a same lock.