Mixed Lock Mechanism for Concurrent File Access

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current file locking mechanisms in computer systems, such as those used in virtual machines, hinder concurrent access performance by requiring exclusive locks during file expansion or truncation, which blocks read operations on unchanged data blocks, thereby degrading read and write performance.

Innovation Solution

Introducing a mixed lock mechanism that allows a thread to perform read or write operations on files, enabling other threads to obtain shared locks for unchanged data blocks while preventing exclusive or mixed locks, thus allowing concurrent access and improving performance during file expansion or truncation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If an exclusive lock is obtained during file expansion or truncation, then file modification operations can be performed safely, but read operations on unchanged data blocks are blocked

Engineering Contradiction:
Improvefile modification safetyVSAvoidconcurrent read performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the file into changed blocks and unchanged blocks, applying different locking mechanisms to each. Exclusive locks are obtained only for changed blocks that require modification, while unchanged blocks remain accessible for concurrent read operations. This segmentation allows the system to maintain file modification safety while enabling concurrent reads on unaffected portions of the file.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies different lock types to different portions of the file based on their modification status. Changed blocks receive exclusive locks to ensure safe modification, while unchanged blocks allow shared locks for reading. This local differentiation of lock quality enables concurrent access patterns where reads can proceed on stable data while writes occur on modified data.

Inventive Principle:
Principle #3Local quality

2Reliability

If a traditional lock mechanism is used, then data consistency is maintained, but concurrent access performance is degraded

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

Solution Approach 1:

The patent dynamically adjusts locking granularity and lock type based on the actual file operation being performed. Instead of uniformly applying exclusive locks to entire files during modification operations, the system dynamically identifies only the specific blocks requiring changes and applies locks selectively. This dynamic approach maintains data consistency for modified blocks while minimizing lock contention and reducing access time for concurrent operations on unchanged blocks.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent transitions from a single-dimension locking approach (file-level exclusive locks) to a multi-dimensional approach by introducing block-level locking granularity. This dimensional change allows the system to differentiate between changed and unchanged blocks, applying appropriate lock types at the block level rather than uniformly at the file level, thereby reducing unnecessary lock contention and improving concurrent access performance.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

3Reliability

If an exclusive lock is obtained for the entire file, then write operations are protected, but read and write performance are degraded

Engineering Contradiction:
Improvewrite operation protectionVSAvoidread and write performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the file into multiple blocks and applies locking at the block level rather than the file level. When write operations need to modify specific blocks, exclusive locks are obtained only for those particular blocks. Other blocks that are not being modified remain accessible for concurrent read operations. This segmentation approach protects write operations on specific blocks while maintaining high read and write performance on unchanged portions of the file.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies different lock types locally to different blocks based on their modification requirements. Blocks that are being written to receive exclusive locks for protection, while blocks that are not being modified allow concurrent shared locks for reading. This local differentiation maintains write operation protection where needed while maximizing overall read and write performance across the file.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10324902B2Method and apparatus for locking file in memory
Publication Date: 2019.06.18 EMC IP HLDG CO LLC
  • US10324902B2 patent drawing
  • US10324902B2 patent drawing
  • US10324902B2 patent drawing

AI summary

Embodiments of the present disclosure relate to a method and apparatus for locking a file in a memory. The method comprises enabling a thread to obtain a mixed lock of a file. The method further comprises, in response to enabling the thread to obtain the mixed lock, enabling a further thread to obtain a shared lock of the file, and prevent the further thread from obtaining the exclusive lock or mixed lock of the file. By adding a new mixed lock to a traditional read and write lock, embodiments of the present disclosure improve concurrent access performance of the file system.