Automatic Marshalling for Cross-Thread Method Calls

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multi-threaded runtime environments, efficiently handling method calls between threads is cumbersome due to the need for manual marshalling, which increases the risk of errors if not implemented correctly, especially when the number of methods requiring marshalling is large.

Innovation Solution

A method for compiling source code into object code that identifies and rewrites marshalling attributes associated with method code intended for execution in a secondary thread, allowing for automatic marshalling during the compilation process, thereby simplifying the threading requirements and reducing the risk of errors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual marshalling code is added to each method, then thread safety is ensured, but device complexity and programming burden increase

Engineering Contradiction:
Improvethread safetyVSAvoidcode complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The marshalling logic is performed in advance during the compilation process rather than at runtime. The compiler automatically generates the necessary marshalling code before the program executes, so that when the program runs, only simple method calls are needed without complex thread-checking logic.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The compilation system automatically performs the marshalling task without requiring manual intervention from the programmer. The compiler detects when marshalling is needed and automatically generates the appropriate code, making the system self-sufficient and eliminating the need for developers to manually implement thread-safe marshalling logic.

Inventive Principle:
Principle #25Self-service

2Reliability

If manual marshalling is implemented, then thread interaction is controlled, but ease of operation deteriorates due to syntax errors and programming burden

Engineering Contradiction:
Improvethread interaction controlVSAvoidprogramming ease
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The compiler automatically handles thread interaction control by detecting marshalling requirements and generating appropriate code. Developers simply write their business logic without needing to manually implement thread-safe marshalling, significantly improving ease of operation while maintaining reliable thread interaction control.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The manual mechanical process of writing and verifying marshalling code is replaced by an automated compilation process. Instead of developers manually writing and checking marshalling syntax, the compiler automatically performs this mechanical task, eliminating syntax errors and reducing programming burden.

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

3Stability of the object's composition

If synchronous marshalling is used, then data consistency is ensured, but productivity decreases due to waiting for method completion

Engineering Contradiction:
Improvedata consistencyVSAvoidexecution efficiency
Core Design Contradiction:
Stability of the object's compositionVSProductivity

Solution Approach 1:

The system dynamically adapts the marshalling behavior based on the specific requirements of each method call. Instead of forcing synchronous marshalling for all calls, the compiler allows asynchronous marshalling when appropriate, enabling the program to switch between synchronous and asynchronous modes depending on the operational context and performance needs.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10114625B2Handling cross-thread method calls
Publication Date: 2018.10.30 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10114625B2 patent drawing
  • US10114625B2 patent drawing
  • US10114625B2 patent drawing

AI summary

A method of compiling source code into object code for a multi-threaded runtime environment is disclosed. Source code is compiled into object code using a compilation engine. Marshalling attributes associated with method code intended for executing in a secondary thread are identified. The marshalling attributes and the method code are rewritten as marshaled method code for executing the method code in the secondary thread according to the identified marshalling attributes.