Mutual Trust Locking for Concurrent Writes to Shared Resources

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current read-write lock mechanisms in multi-thread programming lead to low efficiency in concurrent access to shared resources, particularly when large-scale concurrency involves threads accessing different ranges of a protected resource, as they require a write lock on the entire resource, serially processing it despite threads operating on different data units.

Innovation Solution

Implementing a mutual trust lock state that allows multiple threads to concurrently perform write operations on different data units of a shared resource, using a lock status variable to manage lock acquisition and release, ensuring non-exclusive write operations and avoiding conflicts.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a write lock is acquired to lock the entire shared resource to ensure consistency, then security of the shared resource is improved, but efficiency of concurrent access by multiple threads deteriorates

Engineering Contradiction:
Improveconsistency of protected resourceVSAvoidefficiency of concurrent access
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the shared resource into multiple data units (e.g., array elements, struct fields) and introduces fine-grained locks that can lock individual data units rather than the entire resource. This allows threads to access different data units concurrently while maintaining consistency within each locked unit, thereby improving concurrent access efficiency while preserving security.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies different locking strategies to different parts of the shared resource based on access patterns. Threads accessing different data units can acquire fine-grained locks on specific units rather than a global lock, allowing local concurrent access while maintaining global consistency. This localizes the quality of locking to match the scope of actual data access.

Inventive Principle:
Principle #3Local quality

2Productivity

If a fine-grained lock is used to allow concurrent access to different data units, then efficiency of concurrent access is improved, but complexity of lock management deteriorates

Engineering Contradiction:
Improveefficiency of concurrent accessVSAvoidcomplexity of lock management
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent merges multiple fine-grained locks into a coarse-grained lock structure that automatically manages the locking hierarchy. The lock manager consolidates lock acquisition and release operations, reducing the burden on programmers to manually manage individual fine-grained locks while still enabling concurrent access to different data units.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent introduces a lock manager as an intermediary component that handles fine-grained lock operations. This mediator abstracts the complexity of managing multiple fine-grained locks, providing a simplified interface for thread synchronization while maintaining the benefits of fine-grained locking for concurrent access efficiency.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP4726550A1Multi-threaded concurrent access method and apparatus
Publication Date: 2026.04.15 HUAWEI TECH CO LTD
  • EP4726550A1 patent drawingFigure 1~2
  • EP4726550A1 patent drawingFigure 3
  • EP4726550A1 patent drawingFigure 4

AI summary

Embodiments of this application disclose a multi-thread concurrent access method, to improve efficiency of concurrent access to a shared resource by a plurality of threads. The method in embodiments of this application includes: A computing device receives a first lock acquire request, where the first lock acquire request is used to request a mutual trust lock for performing a write operation on a shared resource by a first thread, and the mutual trust lock is used for performing a non-exclusive write operation on the shared resource. The computing device issues the mutual trust lock to the first thread based on the first lock acquire request. The first thread and a second thread concurrently perform write operations on the shared resource based on the mutual trust lock, where the second thread is a thread that has acquired the mutual trust lock.