In-order Execution in Asynchronous Programming via Result Handlers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In asynchronous programming environments, ensuring in-order execution of programming statements is challenging, especially when asynchronous functions are involved, leading to potential delays and poor application performance due to synchronous calls that block the main thread.

Innovation Solution

A compiler transforms source code by identifying asynchronous tasks and configuring subsequent statements to execute only upon completion of these tasks, using result handlers and block function chaining to ensure in-order execution without requiring blocking calls or busy waits.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If asynchronous tasks are used to improve application responsiveness, then application responsiveness is improved, but execution order control deteriorates

Engineering Contradiction:
Improveapplication responsivenessVSAvoidexecution order control
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent introduces result handlers as intermediary components that mediate between asynchronous task completion and subsequent statement execution. The result handler receives the completion signal from the asynchronous task and triggers the execution of dependent statements, ensuring proper sequencing without blocking the main thread. This intermediary mechanism allows asynchronous operations to maintain both responsiveness and execution order control.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If blocking calls are used to ensure in-order execution, then execution order control is improved, but application responsiveness deteriorates

Engineering Contradiction:
Improveexecution order controlVSAvoidapplication responsiveness
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent replaces the mechanical blocking mechanism (synchronous waiting) with an event-driven mechanism using result handlers and callbacks. Instead of the main thread being mechanically blocked by synchronous calls, the system uses asynchronous event notification where result handlers are invoked automatically when tasks complete, substituting the blocking mechanical system with a non-blocking event-based system that maintains execution order.

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

3Reliability

If synchronous calls are used to maintain execution order, then execution order control is improved, but development time deteriorates

Engineering Contradiction:
Improveexecution order controlVSAvoiddevelopment time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent implements self-service through automatic result handler chaining and compiler-generated sequencing code. The system automatically manages the complex task of tracking asynchronous completions and triggering subsequent statements without requiring manual intervention or complex developer orchestration. The compiler and runtime automatically handle the sequencing logic, reducing development time while maintaining execution order control.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS8701096B2In-order execution in an asynchronous programming environment
Publication Date: 2014.04.15 ADOBE INC
  • US8701096B2 patent drawing
  • US8701096B2 patent drawing
  • US8701096B2 patent drawing

AI summary

A computer implemented method includes receiving an ordered sequence of programming language statements, identifying a first statement and one or more second statements that are configured to be executed after the first statement, in which the first statement is configured to initiate an asynchronous task that executes asynchronously with respect to the one or more second statements, and configuring the one or more second statements to execute upon completion of the asynchronous task.