Dynamic Locking Protocol Using Object Counters for Database Concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database systems face challenges in managing concurrent access and updates from multiple threads, leading to deadlocks and inefficient resource usage, particularly when object identifiers are customizable and determined at runtime, which complicates traditional locking mechanisms.

Innovation Solution

The method employs counters attached to object definitions to monitor status during reading and writing, treating all threads as readers initially, and converting them to writer threads only when all necessary objects are secured, with a global critical section to manage locks and ensure atomic conversion, thereby preventing deadlocks and optimizing resource usage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional locking mechanisms are used to manage concurrent access, then database integrity is maintained, but deadlocks occur and resource usage becomes inefficient

Engineering Contradiction:
Improvedatabase integrityVSAvoidconcurrent access efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the database into object-level units with individual locks instead of using a monolithic locking mechanism. Each object has its own counter and lock, allowing fine-grained concurrent access. This segmentation prevents deadlocks by enabling readers to access multiple objects simultaneously without requiring global lock ordering, while maintaining integrity through atomic conversion of reader locks to writer locks.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements dynamic locking where threads can transition from reader mode to writer mode atomically. The lock state is not fixed but dynamically changes based on operational needs. Writer threads convert all their reader locks to writer locks simultaneously, and the system dynamically adjusts lock states based on whether objects are being read or written, optimizing resource usage.

Inventive Principle:
Principle #15Dynamics

2Reliability

If the entire database is locked to prevent deadlocks, then data consistency is ensured, but resource usage efficiency decreases

Engineering Contradiction:
Improvedata consistencyVSAvoidresource usage efficiency
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

Instead of locking the entire database, the patent applies segmentation at the object level. Each object has its own counter (m-read, m-writer) and lock mechanism. This allows multiple objects to be accessed concurrently by different threads without locking the whole database, significantly improving resource usage efficiency while maintaining data consistency through localized locking.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local locking quality where each object receives tailored lock management appropriate to its access patterns. Objects being read have reader locks, objects being written have writer locks, and the locking behavior is localized to specific objects rather than applying uniformly across the entire database.

Inventive Principle:
Principle #3Local quality

3Reliability

If objects are locked in numerical order to prevent deadlocks, then deadlock prevention is achieved, but the system becomes complex when object identifiers are customizable

Engineering Contradiction:
Improvedeadlock preventionVSAvoidlocking mechanism complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The locking mechanism is self-managing through object-level counters that automatically track read and write operations. The counter (m-read, m-writer) self-updates during operations, and the system automatically determines when to convert reader locks to writer locks or release locks, eliminating the need for external deadlock prevention algorithms or complex ordering protocols.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent changes the locking parameters from fixed numerical ordering to dynamic state-based locking. Instead of locking objects in a predetermined order, the system uses counter values (m-read, m-writer) to dynamically determine lock acquisition and conversion, simplifying the mechanism for customizable object identifiers while maintaining deadlock prevention.

Inventive Principle:
Principle #35Parameter changes

4Adaptability or versatility

If reader threads convert to writer threads individually, then flexibility is achieved, but wait times increase

Engineering Contradiction:
Improvethread conversion flexibilityVSAvoidwait time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent merges multiple individual lock conversions into a single atomic operation. When a thread converts all its reader locks to writer locks simultaneously in one atomic step, it eliminates the sequential wait time that would occur if conversions happened individually. This merging of conversions achieves both flexibility and reduced wait time.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The system performs preliminary action by having threads acquire all necessary reader locks before attempting conversion to writer locks. The atomic conversion happens only when all reader locks are secured, preparing the thread in advance for efficient writer mode operation without unnecessary waiting.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8176022B1Locking protocol using dynamic locks and dynamic shared memory
Publication Date: 2012.05.08 GARCIA RADAMES
  • US8176022B1 patent drawing
  • US8176022B1 patent drawing
  • US8176022B1 patent drawing

AI summary

The present invention discloses a Locking Protocol using Dynamic Locks and Dynamic Shared Memory which provides a method whereby a designated critical section monitors object status through employment of counters attached to the object=s definition that will increment and decrement during reading and writing.