Parallelizing Sequential Loops via Transactional Memory Commit Arbitration

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software transactional memory systems face challenges in ensuring a predictable commit order for transactions, leading to potential conflicts and difficulties in parallel programming, especially when executing loops in parallel, where the order of execution is critical.

Innovation Solution

A transactional memory system is enhanced with a feature to specify a pre-determined commit order for transactions, using a commit arbitrator to enforce total or partial ordering, and transform sequential loops into parallel loops while preserving the original input to output mapping by assigning transactions to different threads.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If transactions are allowed to commit in arbitrary order in a typical STM environment, then parallel execution efficiency is improved, but program correctness becomes difficult to guarantee

Engineering Contradiction:
Improveparallel execution efficiencyVSAvoidprogram correctness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent applies preliminary action by pre-determining the commit order of transactions before they actually commit. The system assigns commit order numbers to transactions in advance, based on their creation order or other predetermined criteria, so that when transactions are ready to commit, their execution order is already established. This prevents the need for dynamic contention management during commit, ensuring both parallel execution efficiency and program correctness.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If a pre-determined commit order is enforced for transactions, then program correctness is improved, but execution flexibility and parallelism are reduced

Engineering Contradiction:
Improveprogram correctnessVSAvoidexecution flexibility
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments transactions into different commit groups based on their commit order numbers. Each group can execute and commit independently according to its assigned order, allowing parallel execution within groups while maintaining sequential ordering between groups. This segmentation enables the system to achieve both predetermined commit order and execution flexibility by allowing concurrent processing of multiple transaction groups simultaneously.

Inventive Principle:
Principle #1Segmentation

3Productivity

If sequential loops are executed in parallel without extra precautions, then execution speed is improved, but unexpected results occur due to side effects or order dependency

Engineering Contradiction:
Improveexecution speedVSAvoidexecution correctness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent introduces commit order numbers as an intermediary mechanism between sequential loop iterations and parallel execution. Each iteration is wrapped in a transaction with a predetermined commit order number, and the commit arbitrator uses these numbers to ensure that iterations commit in the correct sequence. This intermediary allows the loop to execute in parallel while maintaining the original sequential input-output mapping, preventing unexpected results from side effects or order dependency.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8010550B2Parallelizing sequential frameworks using transactions
Publication Date: 2011.08.30 MICROSOFT TECHNOLOGY LICENSING LLC
  • US8010550B2 patent drawing
  • US8010550B2 patent drawing
  • US8010550B2 patent drawing

AI summary

Various technologies and techniques are disclosed for transforming a sequential loop into a parallel loop for use with a transactional memory system. A transactional memory system is provided. A first section of code containing an original sequential loop is transformed into a second section of code containing a parallel loop that uses transactions to preserve an original input to output mapping. For example, the original sequential loop can be transformed into a parallel loop by taking each iteration of the original sequential loop and generating a separate transaction that follows a pre-determined commit order process. At least some of the separate transactions are executed in different threads. When an unhandled exception is detected that occurs in a particular transaction while the parallel loop is executing, state modifications made by the particular transaction and predecessor transactions are committed, and state modifications made by successor transactions are discarded.