Hardware Transactional Memory Atomic Multi-Word Compare-and-Swap

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current lock-free indexing techniques in main-memory database systems face challenges in designing and implementing state changes that span memory addresses without using mutual exclusion locks, particularly in achieving high performance and concurrency, especially with the limitations of hardware transactional memory (HTM) leading to high abort rates and performance degradation under high contention scenarios.

Innovation Solution

The system employs a hardware transactional memory (HTM) to perform atomic multi-word compare-and-swap (MWCAS) operations on a mapping table, allowing for latch-free updates and maintaining lock freedom by using hardware primitive operations, thereby simplifying the design and implementation of lock-free indexing methods and improving performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If hardware transactional memory (HTM) is used to perform atomic operations on mapping table entries, then lock freedom and concurrency are improved, but abort rates increase and performance degrades under high contention scenarios

Engineering Contradiction:
Improvelock freedomVSAvoidabort rate
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent segments the mapping table into multiple partitions, allowing concurrent operations on different partitions without requiring global locks or causing system-wide aborts. This segmentation isolates conflicts to local partitions only, reducing the abort rate while maintaining lock freedom.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces version vectors as an intermediary mechanism that mediates concurrent updates to mapping table entries. Version vectors enable optimistic concurrency control by allowing multiple versions to coexist and be resolved without immediate aborts, reducing the harmful effects of high contention.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Stability of the object's composition

If hardware transactional memory (HTM) is used to perform atomic multi-word compare-and-swap operations, then atomicity and consistency are improved, but device complexity and implementation difficulty increase

Engineering Contradiction:
ImproveatomicityVSAvoidimplementation complexity
Core Design Contradiction:
Stability of the object's compositionVSDevice complexity

Solution Approach 1:

The patent creates a universal atomic multi-word compare-and-swap operation that can be applied to any mapping table entry regardless of its specific structure or state. This multi-functional atomic operation simplifies the implementation by providing a single standardized mechanism for ensuring atomicity across diverse scenarios.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The atomic multi-word compare-and-swap operation is implemented as a self-service hardware primitive that automatically ensures atomicity and consistency without requiring complex software coordination or additional synchronization mechanisms, reducing implementation complexity.

Inventive Principle:
Principle #25Self-service

3Ease of manufacture

If traditional locking mechanisms are used to control mapping table updates, then simplicity of implementation is improved, but concurrency and performance are degraded

Engineering Contradiction:
Improveimplementation simplicityVSAvoidconcurrency
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The patent replaces the mechanical locking system with hardware transactional memory primitives that provide atomic operations without mutual exclusion locks. This substitution maintains implementation simplicity through standardized atomic instructions while dramatically improving concurrency by eliminating lock contention.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent changes the fundamental parameter of synchronization from binary lock states (locked/unlocked) to atomic operation outcomes (success/abort with retry). This parameter change enables high concurrency by allowing multiple threads to attempt operations simultaneously without blocking, while maintaining implementation simplicity through hardware-supported atomic primitives.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentEP3304298B1Controlling atomic updates of indexes using hardware transactional memory
Publication Date: 2021.01.27 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3304298B1 patent drawingFigure 1
  • EP3304298B1 patent drawingFigure 2A~2B
  • EP3304298B1 patent drawingFigure 2C

AI summary

A current state of one or more entries in a mapping table that are associated with latch-free updates of a data structure that uses indirection mapping tables is accessed. A transformation of the current state of the one or more entries in the mapping table to a transformed state of the entries in the mapping table, is controlled. The controlling includes initiating an atomic multi-word compare-and-swap (MWCAS) operation on a plurality of words using a hardware transactional memory (HTM) resident in a device processor, and the MWCAS operation is performed using hardware primitive operations of the HTM, via the device processor. A transformation of a current state of the data structure to an updated state of the data structure, is controlled, via the transformation of the current state of the one or more entries in the mapping table to the transformed state of the entries in the mapping table.