Transactional Native Method Execution in Managed Environments

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The overhead costs associated with transitioning between managed and native execution modes in computer programming environments are high, often deterring the use of native code execution despite its potential performance benefits, and can lead to undesirable programming practices.

Innovation Solution

The implementation of memory transactions, specifically using transactional memory to execute native calls and manage transitions between execution modes, allowing for optimized execution by omitting or simplifying transition operations if the transaction is successful, and falling back to traditional execution if it fails.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If native code execution is used to improve performance, then execution speed is improved, but transition overhead increases

Engineering Contradiction:
Improveexecution speedVSAvoidtransition overhead
Core Design Contradiction:
SpeedVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-compiling native code segments and preparing transition mechanisms before actual execution. The runtime system pre-loads native libraries and establishes execution contexts in advance, so that when native code execution is needed, the transition overhead is minimized because the preparatory work has already been completed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary layer (the runtime system with transactional memory) that mediates between managed and native execution modes. This intermediary handles the complex transition operations, memory management, and state synchronization, isolating the overhead costs from the core execution path and enabling smoother transitions between execution modes.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If transition operations are performed to ensure safe mode switching, then execution safety is improved, but transition complexity increases

Engineering Contradiction:
Improveexecution safetyVSAvoidtransition complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system changes execution parameters dynamically based on the transaction outcome. When a memory transaction succeeds, the system transitions to a simplified execution mode with reduced safety checks. When transactions fail or are not used, traditional safety mechanisms are activated. This parameter switching allows the system to adapt safety levels to actual execution needs, reducing unnecessary complexity.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The transition mechanism is designed to be dynamic rather than static. The runtime system can adjust transition operations based on runtime conditions, such as whether transactional memory is available, whether the current execution context requires full safety checks, and whether native code segments have been pre-validated. This dynamic adaptation reduces transition complexity in safe contexts while maintaining reliability when needed.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS9740597B2Transactional execution of native methods
Publication Date: 2017.08.22 ORACLE INT CORP
  • US9740597B2 patent drawing
  • US9740597B2 patent drawing
  • US9740597B2 patent drawing

AI summary

Approaches for more efficiently executing calls to native code from within a managed execution environment are described. The techniques involve attempting to execute a native call, such as a call to a C function from within Java code, using a single hardware transaction. Not only is the native code executed in a hardware transaction, but also various transitional operations needed for transitioning between managed execution mode and native execution mode. If the hardware transaction is successful, at least some of the operations that would normally be performed during transitions between modes may be omitted or simplified. If the hardware transaction is unsuccessful, the native calls may be performed as they normally would, outside of hardware transactions.