Shared Data Access Locking for Reader-Writer Thread Coordination

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for handling multiple parallel threads in accessing a shared data set, such as hardware and software transactional memory, are resource-intensive and inefficient, particularly when writer threads block reader threads with exclusive locks.

Innovation Solution

A method that records reader thread states in a data structure, selectively acquires shared locks, interrupts processing in response to exclusive lock requests, restores thread states, and resumes processing after exclusive locks are released, minimizing the need for transactional memory implementations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If exclusive locks are used to block writer threads, then data consistency is ensured, but reader thread productivity deteriorates

Engineering Contradiction:
Improvedata consistencyVSAvoidreader thread productivity
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The lock mechanism is segmented into shared locks for readers and exclusive locks for writers. Multiple reader threads can simultaneously hold shared locks on the same data set, while writer threads require exclusive locks that prevent other writers but allow readers to proceed. This segmentation resolves the contradiction by allowing concurrent reader access while maintaining data consistency through controlled writer access.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The locking mechanism dynamically adjusts based on thread type and access patterns. Reader threads acquire shared locks that coexist with other shared locks, while writer threads transition to exclusive locks that block other writers. The system dynamically manages lock states, thread priorities, and wait queues to optimize both data consistency and reader productivity simultaneously.

Inventive Principle:
Principle #15Dynamics

2Reliability

If transactional memory implementations are used to manage parallel threads, then thread coordination reliability is improved, but resource consumption increases

Engineering Contradiction:
Improvethread coordination reliabilityVSAvoidresource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent replaces expensive hardware transactional memory with lighter-weight software lock objects. These lock objects are simple data structures that track lock state, owner thread, and wait queues without requiring complex hardware support or extensive software transaction logs. The simplified lock mechanism achieves thread coordination reliability with significantly reduced resource consumption.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

Solution Approach 2:

The patent extracts the essential locking functionality from complex transactional memory systems, isolating only the necessary lock acquisition, release, and waiting mechanisms. This extracted locking subsystem provides sufficient thread coordination for reader-writer scenarios without the overhead of full transactional memory implementation, reducing both memory usage and processing overhead.

Inventive Principle:
Principle #2Taking out (Extraction)

3Productivity

If shared locks are held for extended periods to complete read operations, then reader thread productivity is improved, but exclusive lock acquisition time worsens

Engineering Contradiction:
Improvereader thread productivityVSAvoidexclusive lock acquisition time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

Writer threads are placed in wait queues before attempting to acquire exclusive locks, allowing the system to prepare for the transition from shared to exclusive locking in advance. Reader threads are notified of pending writer requests, enabling them to voluntarily yield or complete critical sections before the exclusive lock is granted. This preliminary preparation reduces the actual lock acquisition time while maintaining reader productivity.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The locking mechanism implements feedback loops where writer threads signal their intent to acquire exclusive locks, and reader threads receive notifications about pending writers. This feedback enables readers to adjust their behavior dynamically - either completing read operations faster or yielding gracefully - thereby reducing exclusive lock acquisition time without permanently sacrificing reader productivity.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12561164B2Accessing a shared data set
Publication Date: 2026.02.24 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US12561164B2 patent drawing
  • US12561164B2 patent drawing
  • US12561164B2 patent drawing

AI summary

A computer implemented method of accessing a shared data set using a shared and an exclusive lock is provided. The method includes: initiating at least one reader thread configured to perform a read operation; recording a reader thread state for the at least one reader thread in a data structure; selectively acquiring the shared lock for the at least one reader thread; implementing processing of the at least one reader thread; selectively interrupting the processing of the at least one reader thread in response to an exclusive lock request; restoring the at least one reader thread state using the reader thread state recorded in the data structure and releasing the shared lock; acquiring an exclusive lock; resuming the processing of the at least one reader thread; reacquiring the shared lock for the at least one reader thread in response to determining a releasing of the exclusive lock.