# US 10,956,185 B2 · Threading as a service

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

- Number: US 10,956,185 B2
- Document ID: US10956185B2
- Status: Granted
- Kind: B2
- Application number: 16/200,275
- Filed: 2018-11-26
- Published: 2019-06-06
- Granted: 2021-03-23
- Earliest claimed: 2014-09-30
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Timothy Allen Wagner
- Web page: https://patentgrep.com/patent/US10956185B2

## CPC

- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 9/445: Program loading or initiating (bootstrapping G06F9/4401; security arrangements for program loading or initiating G06F21/57)
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/50: Allocation of resources, e.g. of the central processing unit [CPU]
- G06F 9/5027: {the resource being a machine, e.g. CPUs, Servers, Terminals}
- G06F 9/5077: {Logical partitioning of resources; Management or configuration of virtualized resources (specific details on emulation or internal functioning of virtual machines G06F9/455)}
- G06F 2009/45562: {Creating, deleting, cloning virtual machine instances}
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F 2009/45575: {Starting, stopping, suspending or resuming virtual machine instances}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A service manages a plurality of virtual machine instances for low latency execution of user codes. The plurality of virtual machine instances can be configured based on a predetermined set of configurations. One or more containers may be created within the virtual machine instances. In response to a request to execute user code, the service identifies a pre-configured virtual machine instance suitable for executing the user code. The service can allocate the identified virtual machine instance to the user, create a new container within an instance already allocated to the user, or re-use a container already created for execution of the user code. When the user code has not been activated for a time-out period, the service can invalidate allocation of the virtual machine instance destroy the container. The time from receiving the request to beginning code execution is less than a predetermined duration, for example, 100 ms.

## Claims

### Claim 1

A computer-implemented method to process requests to execute user code on one or more virtual machine instances, the method comprising:
as implemented by one or more computing devices configured with specific executable instructions,
providing a plurality of warmed virtual machine instances, each of the warmed virtual machine instances containing a software component associated with a programming language, wherein the plurality of warmed virtual machine instances comprises a first virtual machine instance contains a first language runtime associated with a first programming language;
subsequent to providing the plurality of warmed virtual machine instances, processing a request to execute a user code on behalf of a user, wherein the request indicates one or more user-specified arguments to the user code that are specified by the user;
identifying, based at least in part on the user code being associated with the first programming language, a first virtual machine instance from the plurality of warmed virtual machine instances that contains the first language runtime usable to execute the user code; and
executing the user code on the first virtual machine instance using the one or more user-specified arguments indicated by the processed request and the first language runtime.

### Claim 2 (depends on 1)

The method of claim 1, wherein the request is associated with a user code identifier, the method further comprising using the user code identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that was used to execute the user code prior to the processing of the request.

### Claim 3 (depends on 1)

The method of claim 1, wherein the request is associated with an operating system identifier, the method further comprising using the operating system identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is running an operating system associated with the operating system identifier.

### Claim 4 (depends on 1)

The method of claim 1, wherein the request is associated with a language runtime identifier, the method further comprising using the language runtime identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is running the first language runtime associated with the language runtime identifier.

### Claim 5 (depends on 1)

The method of claim 1, wherein the request is associated with a user code identifier, the method further comprising using the user code identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that already has the user code loaded thereon.

### Claim 6 (depends on 1)

The method of claim 1, wherein the request is associated with a security policy identifier, the method further comprising using the security policy identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is associated with a security policy associated with the security policy identifier.

### Claim 7 (depends on 1)

The method of claim 1, further comprising, based on an occurrence of an event configured to trigger automatic generation of the request to execute the user code, generating the request to execute the user code.

### Claim 8

A system for processing requests to execute user code on one or more virtual machine instances, the system comprising:
one or more processors;
one or more memories having stored thereon instructions, which, when executed by the one or more processors, cause the one or more processors to:
cause a plurality of warmed virtual machine instances to be provided, each of the warmed virtual machine instances containing a software component associated with a programming language, wherein the plurality of warmed virtual machine instances comprises a first virtual machine instance contains a first language runtime associated with a first programming language;
subsequent to causing the plurality of warmed virtual machine instances to be provided, process a request to execute a user code on behalf of a user, wherein the request indicates one or more user-specified arguments to the user code that are specified by the user;
identify, based at least in part on the user code being associated with the first programming language, a first virtual machine instance from the plurality of warmed virtual machine instances that contains the first language runtime usable to execute the user code; and
cause the user code to be executed on the first virtual machine instance using the one or more user-specified arguments indicated by the processed request and the first language runtime.

### Claim 9 (depends on 8)

The system of claim 8, wherein the request is associated with a user code identifier, the instructions, when executed, further causing the one or more processors to use the user code identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that was used to execute the user code prior to the processing of the request.

### Claim 10 (depends on 8)

The system of claim 8, wherein the request is associated with an operating system identifier, the instructions, when executed, further causing the one or more processors to use the operating system identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is running an operating system associated with the operating system identifier.

### Claim 11 (depends on 8)

The system of claim 8, wherein the request is associated with a language runtime identifier, the instructions, when executed, further causing the one or more processors to use the language runtime identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is running the first language runtime associated with the language runtime identifier.

### Claim 12 (depends on 8)

The system of claim 8, wherein the request is associated with a user code identifier, the instructions, when executed, further causing the one or more processors to use the user code identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that already has the user code loaded thereon.

### Claim 13 (depends on 8)

The system of claim 8, wherein the request is associated with a security policy identifier, the instructions, when executed, further causing the one or more processors to use the security policy identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is associated with a security policy associated with the security policy identifier.

### Claim 14 (depends on 8)

The system of claim 8, wherein the instructions, when executed, further cause the one or more processors to, based on an occurrence of an event configured to trigger automatic generation of the request to execute the user code, generate the request to execute the user code.

### Claim 15

Non-transitory physical computer storage storing specific executable instructions, which, when executed by a computer system, cause the computer system to:
cause a plurality of warmed virtual machine instances to be provided, each of the warmed virtual machine instances containing a software component associated with a programming language, wherein the plurality of warmed virtual machine instances comprises a first virtual machine instance contains a first language runtime associated with a first programming language;
subsequent to causing the plurality of warmed virtual machine instances to be provided, process a request to execute a user code on behalf of a user, wherein the request indicates one or more user-specified arguments to the user code that are specified by the user;
identify, based at least in part on the user code being associated with the first programming language, a first virtual machine instance from the plurality of warmed virtual machine instances that contains the first language runtime usable to execute the user code; and
cause the user code to be executed in the first virtual machine instance using the one or more user-specified arguments indicated by the processed request and the first language runtime.

### Claim 16 (depends on 15)

The non-transitory physical computer storage of claim 15, wherein the request is associated with a user code identifier, the instructions, when executed, further causing the computer system to use the user code identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that was used to execute the user code prior to the processing of the request.

### Claim 17 (depends on 15)

The non-transitory physical computer storage of claim 15, wherein the request is associated with an identifier, the instructions, when executed, further causing the computer system to use the identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that has (i) an operating system associated with the identifier, or (ii) a library associated with the identifier.

### Claim 18 (depends on 15)

The non-transitory physical computer storage of claim 15, wherein the instructions, when executed, further cause the computer system to, based on an occurrence of an event configured to trigger automatic generation of the request to execute the user code, generate the request to execute the user code.

### Claim 19 (depends on 15)

The non-transitory physical computer storage of claim 15, wherein the request is associated with a user code identifier, the instructions, when executed, further causing the computer system to use the user code identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that already has the user code loaded thereon.

### Claim 20 (depends on 15)

The non-transitory physical computer storage of claim 15, wherein the request is associated with a security policy identifier, the instructions, when executed, further causing the computer system to use the security policy identifier to identify the first virtual machine instance from the plurality of warmed virtual machine instances that is associated with a security policy associated with the security policy identifier.
