Read Write Lock Starvation Prevention via Event Tracking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for preserving data integrity in shared resources within a computing environment often lead to 'starvation' due to an artificially high count of reader processes or threads when one process terminates unexpectedly, requiring closure of all processes or system restart to resolve.

Innovation Solution

A read/write lock mechanism that uses a combination of mutual exclusion objects and read event objects to accurately track reader processes, allowing for safe and graceful handling of unexpected terminations by uniquely identifying and managing read event objects based on predefined naming conventions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a semaphore maintains a count of reader processes to ensure data integrity, then write access control is improved, but the system becomes vulnerable to starvation when processes terminate ungraciously

Engineering Contradiction:
Improvedata integrityVSAvoidwrite access availability
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system implements feedback mechanisms through event objects that notify the semaphore when reader processes terminate. The semaphore subscribes to termination events and automatically decrements the reader count when termination is detected, ensuring the count accurately reflects active readers without requiring manual intervention or system restart.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The read event object automatically manages its own lifecycle and triggers termination detection without external intervention. When a reader process terminates, the event object self-detects this condition and autonomously notifies the semaphore, eliminating the need for graceful shutdown protocols or administrative intervention.

Inventive Principle:
Principle #25Self-service

2Measurement precision

If the semaphore decrements the count only when readers voluntarily release it, then synchronization accuracy is improved, but the system cannot handle unexpected process terminations

Engineering Contradiction:
Improvereader count accuracyVSAvoidhandling of unexpected terminations
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The system establishes event subscription relationships before process termination occurs. The semaphore pre-subscribes to termination events of all reader processes, so when unexpected termination happens, the count decrement is triggered immediately by the pre-established subscription rather than requiring post-termination discovery or manual correction.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The read event object serves as an intermediary between the reader process and the semaphore. It monitors the lifecycle of reader processes and mediates the information flow about termination status to the semaphore, ensuring the semaphore receives accurate termination notifications without directly managing individual process states.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If all processes must be closed or system restarted to resolve starvation, then data integrity is restored, but system availability and productivity are severely impacted

Engineering Contradiction:
Improvedata integrity restorationVSAvoidsystem downtime
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system automatically recovers from starvation conditions through event-driven detection and correction. When termination events are detected, the semaphore self-corrects the reader count without requiring administrative intervention, process closure, or system restart, maintaining continuous availability while restoring data integrity.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system discards inaccurate reader count information when termination events occur and automatically recovers the correct count through event-driven updates. This allows the system to recover from starvation conditions by discarding the stale high count and recovering the accurate lower count that reflects actual active readers.

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS9542235B2Process-safe read/write locks
Publication Date: 2017.01.10 IVANTI US LLC
  • US9542235B2 patent drawing
  • US9542235B2 patent drawing
  • US9542235B2 patent drawing

AI summary

In one embodiment, a non-transitory processor-readable medium stores code representing instructions that when executed cause a processor to obtain a first mutual exclusion object. The first mutual exclusion object can be a write mutual exclusion object associated with a shared resource. The code can further represent instructions that when executed cause the processor to obtain a second mutual exclusion object associated with an object manager module and define a read event object with a name conforming to a predetermined format. The code can further represent instructions that when executed cause the processor to release the second mutual exclusion object, release the first mutual exclusion object, read at least a portion of the shared resource, obtain the second mutual exclusion object, destroy the read event object and release the second mutual exclusion object.