Hardware Transactional Memory Garbage Collection Exception Handling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In hardware-accelerated transactional memory systems, challenges arise from the intersection of hardware acceleration and automatic memory management, particularly due to contention and transaction reexecutions caused by garbage collection, as well as issues with exception handling and data consistency across threads.

Innovation Solution

A method for handling exceptions within hardware-assisted transactions involves creating an exception object, determining if the transaction should be rolled back, and marshaling the exception object out of the transaction, while avoiding false sharing and ensuring data consistency through specialized instructions and cache management.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If hardware accelerated transactional memory is used, then transaction execution speed is improved, but garbage collection overhead increases due to contention and transaction reexecutions

Engineering Contradiction:
Improvetransaction execution speedVSAvoidgarbage collection overhead
Core Design Contradiction:
SpeedVSLoss of time

Solution Approach 1:

The patent segments the card marking table into multiple separate card marking tables, one for each thread. This eliminates contention between threads when accessing and writing to card marking tables during garbage collection, thereby reducing transaction aborts and reexecutions while maintaining the speed benefits of hardware accelerated transactional memory.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces thread-local card marking tables as intermediaries between threads and the garbage collection system. Each thread has its own dedicated card marking table that it can access without contention, while still participating in the overall garbage collection process through periodic merging or scanning of these thread-local tables.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Quantity of substance

If card marking tables are shared among multiple threads, then memory usage is reduced, but transaction aborts increase due to contention

Engineering Contradiction:
Improvememory usageVSAvoidtransaction abort rate
Core Design Contradiction:
Quantity of substanceVSReliability

Solution Approach 1:

The shared card marking table is segmented into multiple thread-local card marking tables. Each thread gets its own dedicated table, eliminating contention and the associated transaction aborts. The total memory usage increases but remains manageable through efficient data structures and periodic consolidation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each thread is assigned a local card marking table with specific properties (dedicated to that thread, no contention). This local quality ensures that each thread can safely write to its own table without causing other threads to abort, while the system as a whole maintains garbage collection functionality.

Inventive Principle:
Principle #3Local quality

3Quantity of substance

If compacting garbage collection is used, then memory efficiency is improved, but data consistency is compromised due to object movement

Engineering Contradiction:
Improvememory efficiencyVSAvoiddata consistency
Core Design Contradiction:
Quantity of substanceVSStability of the object's composition

Solution Approach 1:

The patent performs preliminary actions by having threads periodically flush their thread-local card marking tables to a global structure before garbage collection compaction occurs. This ensures that all references are properly recorded before objects are moved, maintaining data consistency while still allowing memory efficiency improvements from compaction.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements feedback mechanisms where the garbage collection monitor observes card marking table updates and coordinates compaction operations. Before compaction, the system ensures all threads have flushed their tables; during and after compaction, it validates that object movements are properly tracked, maintaining consistency while achieving memory efficiency.

Inventive Principle:
Principle #23Feedback

4Speed

If exception handling is performed within hardware transactions, then exception processing speed is improved, but transaction validation complexity increases

Engineering Contradiction:
Improveexception processing speedVSAvoidtransaction validation complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent extracts exception handling from the normal transaction validation path. When an exception occurs, it is handled through a separate exception handling path that uses specialized instructions to marshal exception objects out of the transaction without requiring full transaction validation. This maintains fast exception processing while simplifying the validation logic.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces an exception handling intermediary that sits between the hardware transaction system and the exception processing logic. This intermediary uses specialized instructions to handle exception objects, marshaling them out of the transaction context without requiring complex validation of the entire transaction, thus maintaining speed while managing complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9658880B2Efficient garbage collection and exception handling in a hardware accelerated transactional memory system
Publication Date: 2017.05.23 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9658880B2 patent drawing
  • US9658880B2 patent drawing
  • US9658880B2 patent drawing

AI summary

Handling garbage collection and exceptions in hardware assisted transactions. Embodiments are practiced in a computing environment including a hardware assisted transaction system. A method includes beginning a hardware assisted transaction, raising an exception while in the hardware assisted transaction, including creating an exception object, determining that the transaction should be rolled back, and as a result of determining that the transaction should be rolled back, marshaling the exception object out of the hardware assisted transaction.