Fine-locked Transactional Memory for Deadlock-Free Concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional locking techniques in computer systems face limitations such as coarse-grained locks not scaling well, leading to thread blocking and increased complexity, while fine-grained locks can cause deadlocks and are inefficient due to the need for transaction rollback mechanisms.

Innovation Solution

The implementation of fine-locked transactional-memory techniques, which use hardware or software transactions to manage locks, allowing for arbitrarily long programmer-specified transactions without deadlocks by partitioning data objects into fine-grained locks and using non-blocking transactions to acquire and release locks efficiently.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If coarse-grained locks are used to protect shared resources, then programming complexity is reduced, but system throughput decreases due to thread blocking and poor scalability

Engineering Contradiction:
Improveprogramming complexityVSAvoidsystem throughput
Core Design Contradiction:
Device complexityVSProductivity

Solution Approach 1:

The patent segments the data object into multiple partitions, each with its own fine-grained lock. This allows threads to access different partitions concurrently without blocking each other, thereby improving system throughput while maintaining manageable programming complexity through automated partition management.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a transactional memory system as an intermediary layer between threads and fine-grained locks. This mediator automatically manages lock acquisition, validation, and rollback, eliminating the need for programmers to manually coordinate fine-grained locks while preserving the concurrency benefits.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If fine-grained locks are used to improve scalability and reduce thread blocking, then system throughput increases, but programming complexity increases and deadlocks become more likely

Engineering Contradiction:
Improvesystem throughputVSAvoidprogramming complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The transactional memory system acts as an intermediary that automatically manages fine-grained lock acquisition and release. Programmers specify transaction boundaries without manually acquiring or releasing individual locks, eliminating deadlock risks and reducing programming complexity while preserving fine-grained concurrency benefits.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The transactional memory system provides self-service by automatically validating transactions, detecting conflicts, and rolling back failed transactions. This eliminates the need for programmers to implement complex deadlock avoidance protocols or manual lock coordination logic.

Inventive Principle:
Principle #25Self-service

3Productivity

If hardware transactional-memory is used to support non-blocking transactions, then thread blocking is reduced, but transaction size is limited by hardware constraints

Engineering Contradiction:
Improveconcurrent access efficiencyVSAvoidtransaction size
Core Design Contradiction:
ProductivityVSLength of moving object

Solution Approach 1:

The patent segments long programmer-specified transactions into multiple shorter non-blocking hardware transactions. Each hardware transaction operates within size limits, but the sequence of segmented transactions collectively implements the full logical transaction, thereby maintaining concurrency efficiency while overcoming hardware size constraints.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary actions by pre-acquiring fine-grained locks on all required data partitions before executing the main transaction body. This preliminary lock acquisition enables the use of non-blocking hardware transactions for the critical section while ensuring that the transaction can proceed without interference from other threads.

Inventive Principle:
Principle #10Preliminary action

4Adaptability or versatility

If software transactional-memory is used to implement transactions, then arbitrary transaction sizes are supported, but efficiency decreases due to rollback overhead

Engineering Contradiction:
Improvetransaction size flexibilityVSAvoidtransaction efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent segments software transactions into smaller units that can be executed with reduced rollback overhead. By dividing the transaction into finer-grained operations on partitioned data, the system limits the scope of potential rollbacks, thereby improving efficiency while maintaining support for arbitrarily large logical transactions through sequential execution of segments.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS7792805B2Fine-locked transactional memory
Publication Date: 2010.09.07 ORACLE AMERICAN INC
  • US7792805B2 patent drawing
  • US7792805B2 patent drawing
  • US7792805B2 patent drawing

AI summary

A method comprises associating a plurality of locks with a data object accessed concurrently by a plurality of threads, where each lock corresponds to a respective partition of the object. The method includes using a first non-blocking transaction (such as a Hardware Transactional-Memory (HTM) transaction) to attempt to complete a programmer-specified transaction. The first non-blocking transaction may access one or more of the locks but may not actually acquire any of the locks. In response to an indication that the first non-blocking transaction failed to complete, the method may include acquiring a set of locks in another non-blocking transaction, where the set of locks corresponds to a set of partitions expected to be accessed in the programmer-specified transaction. If the set of locks is acquired, the method may include performing the memory access operations of the programmer-specified transaction, and releasing the set of locks.