Patent ID: 9411568
Filing Date: 2016-08-09
CPC Classification: G06F

Claim Text:
1. A computer-based method of translating a target computer program to a target program executable code that includes program instructions to perform an asynchronous operation, comprising: a) determining a code fragment that includes an instruction for invoking the asynchronous operation; b) generating a representation of a state machine based on the code fragment and the instruction for invoking the asynchronous operation, the state machine having a first state corresponding to a first portion of the code fragment containing the instruction for invoking the asynchronous operation, and a second state corresponding to a second portion of the code fragment that is to be executed after the asynchronous operation completes; and c) generating executable program code for implementing and invoking the state machine at a runtime of the target computer program, the executable program code including one or more instructions for passing a wrapping function with the asynchronous invocation, the wrapping function setting and employing states of the state machine; the executable program code comprising computer program instructions executable by one or more processors to perform actions including: a) invoking the asynchronous operation from the first portion of the code fragment; b) setting the state machine to be in the second state; c) exiting from the first portion of the code fragment after invoking the asynchronous operation; and d) in response to a completion of the asynchronous operation, employing the state machine to invoke the second portion of the code fragment.