Speculative Parallel Execution with Software Transactional Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Sequential execution of computer programs leads to underutilization of processing capability, as existing methods fail to effectively manage data dependencies in memory for parallel execution.

Innovation Solution

A method and system that create a program replica for each thread, using a speculative runtime engine to modify write operations based on thread-local object speculation, and implement a software transactional memory (STM) system to optimize parallel execution by de-optimizing write operations when objects are not thread-local, storing results in redo logs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If sequential execution is used, then data dependency management is simple, but processing capability is under-utilized

Engineering Contradiction:
Improveprocessing capability utilizationVSAvoiddata dependency management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The program is divided into multiple independent transactions that can execute in parallel. Each transaction operates on its own data structures, allowing simultaneous execution while maintaining simplicity through clear separation of concerns. The segmentation enables multiple threads to work independently without complex inter-thread dependency management.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Thread-local copies of data structures are created for each transaction. Instead of managing complex shared memory dependencies, each thread operates on its own copy, eliminating the need for sophisticated dependency tracking. The copies are later merged or synchronized through simple operations, reducing overall system complexity.

Inventive Principle:
Principle #26Copying

2Reliability

If parallel execution with full STM is used, then data dependencies are properly managed, but overhead is high

Engineering Contradiction:
Improvedata dependency managementVSAvoidoverhead
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system applies different levels of STM implementation to different transactions based on their specific needs. Transactions that access shared objects use full STM with read/write logs, while transactions that only access thread-local objects use simplified STM without logs. This local differentiation reduces overall overhead while maintaining reliability where needed.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

Instead of implementing full STM for all transactions, the system applies STM only to the extent necessary for each specific transaction. By detecting which transactions access shared objects, the system applies partial STM action only where required, avoiding the excessive overhead of universal STM implementation while ensuring data dependency management reliability.

Inventive Principle:
Principle #16Partial or excessive action

3Device complexity

If speculation that objects are thread-local is made, then overhead is reduced, but correctness may be compromised

Engineering Contradiction:
ImproveoverheadVSAvoidexecution correctness
Core Design Contradiction:
Device complexityVSReliability

Solution Approach 1:

The system continuously monitors transaction execution and detects when speculated thread-local objects are actually shared. When a transaction attempts to access an object that another thread is using, the system receives feedback and adjusts by applying full STM to that transaction. This feedback mechanism ensures correctness is maintained while allowing optimization through speculation to reduce overhead in normal cases.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system prepares for potential speculation failures by having fallback mechanisms in place. Before executing optimized transactions based on speculation, the system ensures that shared object detection and full STM implementation are ready to activate if needed. This prior cushioning approach protects correctness while enabling overhead reduction through optimistic speculation.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

Data Source

PatentUS9766926B2Method and system for optimizing parallel program execution based on speculation that an object written to is not shared
Publication Date: 2017.09.19 ORACLE INT CORP
  • US9766926B2 patent drawing
  • US9766926B2 patent drawing
  • US9766926B2 patent drawing

AI summary

A method for executing a program in parallel includes creating a program replica, which includes a write operation on and an identifier of an object and is a copy of the program, for a thread. The identifier specifies whether the object is thread-local. The method includes modifying the write operation based on a speculation that the write operation uses only thread-local objects. The write operation executes in a transaction of the thread. The method includes determining, while executing the program replica and using the identifier, that the object used by the write operation is not thread-local, de-optimizing the write operation by adding instrumentation to implement a software transactional memory (STM) system for the write operation to obtain a de-optimized write operation, and performing the de-optimized write operation on the object to obtain a result and store the result in a redo log.