# US 11,442,715 B1 · Asynchronous framework

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,442,715 B1
- Document ID: US11442715B1
- Status: Granted
- Kind: B1
- Application number: 16/916,063
- Filed: 2020-06-29
- Granted: 2022-09-13
- Earliest claimed: 2020-06-29
- Assignees: Seagate Technology LLC
- Applicants: Seagate Technology LLC
- Inventors: Anatolii Bilenko
- Web page: https://patentgrep.com/patent/US11442715B1

## CPC

- G06F 8/458: {Synchronisation, e.g. post-wait, barriers, locks (synchronisation among tasks G06F9/52)}
- G06F 8/30: Creation or generation of source code
- G06F 8/41: Compilation
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/447: {Target code generation}
- G06F 9/4484: {Executing subprograms}
- G06F 9/4498: {Finite state machines}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A framework, method, and system for generating asynchronous code from state machines coded in a synchronous manner are described. The code is pre-processed into asynchronous code based on the framework prior to compilation thereof. The framework may include various structures and functions such as a save structure, a reentry function, a block wrapping function and a yield identification function.

## Claims

### Claim 1

A method of compiling code comprising:
providing a framework to generate asynchronous programming code comprising:
a save structure to save a present state of a state machine coded in a synchronous manner,
a reentry function to restore the present state of the state machine from the save structure,
a block wrapping function to wrap over potentially-blocking functions of the state machine, and
a yield identification function to identify blocking points within the state machine;
providing code comprising a least one state machine coded in a synchronous manner using the framework;
pre-processing the code using the framework to translate the code into asynchronous code; and
compiling the asynchronous code into an executable program.

### Claim 2 (depends on 1)

The method of claim 1, wherein the save structure, the reentry function, the block wrapping function, and the yield function are included in a library.

### Claim 3 (depends on 2)

The method of claim 2, wherein the library is a C programming language library.

### Claim 4 (depends on 1)

The method of claim 1, wherein the present state of the state machine comprises one or more of coroutine variables and control flow data.

### Claim 5 (depends on 1)

The method of claim 1, wherein the reentry function allows declaration of one or more variables to be saved by the save structure upon a yield of the state machine.

### Claim 6 (depends on 1)

The method of claim 1, wherein the method further comprises executing the executable program in a runtime environment that does not support synchronous code.

### Claim 7 (depends on 1)

The method of claim 1, wherein pre-processing the code using the framework to translate the code into asynchronous code further comprises isolating memory allocations in the code.

### Claim 8

A system for use in compiling code comprising:
a memory to store data; and
a computing apparatus comprising one or more processors and operably coupled to the memory, the computing apparatus configured to:
provide a framework to generate asynchronous programming code comprising:
a save structure to save a present state of a state machine coded in a synchronous manner,
a reentry function to restore the present state of the state machine from the save structure,
a block wrapping function to wrap over potentially-blocking functions of the state machine, and
a yield identification function to identify blocking points within the state machine;
provide code comprising a least one state machine coded in a synchronous manner using the framework;
pre-process the code using the framework to translate the code into asynchronous code; and
compile the asynchronous code into an executable program.

### Claim 9 (depends on 8)

The system of claim 8, wherein the save structure, the reentry function, the block wrapping function, and the yield function are included in a library.

### Claim 10 (depends on 9)

The system of claim 9, wherein the library is a C programming language library.

### Claim 11 (depends on 8)

The system of claim 8, wherein the present state of the state machine comprises one or more of coroutine variables and control flow data.

### Claim 12 (depends on 8)

The system of claim 8, wherein the reentry function allows declaration of one or more variables to be saved by the save structure upon a yield of the state machine.

### Claim 13 (depends on 8)

The system of claim 8, wherein the computing apparatus is further configured to executing the executable program in a runtime environment that does not support synchronous code.

### Claim 14 (depends on 1)

The system of claim 1, wherein pre-processing the code using the framework to translate the code into asynchronous code further comprises isolating memory allocations in the code.

### Claim 15

A framework for use in generating asynchronous programming code comprising:
a save structure to save a present state of a state machine coded in a synchronous manner;
a reentry function to restore the present state of the state machine from the save structure;
a block wrapping function to wrap over potentially-blocking functions of the state machine; and
a yield identification function to identify blocking points within the state machine;
wherein the framework is usable to provide code comprising a least one state machine coded in a synchronous manner;
wherein the save structure, the reentry function, the block wrapping function, and the yield function are usable by a pre-processing method to generate asynchronous programming code from the state machine coded in a synchronous manner;
wherein the asynchronous programming code is usable by a compiler to compile an executable program.

### Claim 16 (depends on 15)

The framework of claim 15, wherein the save structure, the reentry function, the block wrapping function, and the yield function are included in a library.

### Claim 17 (depends on 16)

The framework of claim 16, wherein the library is a C programming language library.

### Claim 18 (depends on 15)

The framework of claim 15, wherein the present state of the state machine comprises one or more of coroutine variables and control flow data.

### Claim 19 (depends on 15)

The framework of claim 15, wherein the reentry function allows declaration of one or more variables to be saved by the save structure upon a yield of the state machine.
