Asynchronous Task Management in On-Demand Code Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In on-demand code execution systems, asynchronous tasks often become blocked due to dependencies, leading to inefficient resource allocation and potential delays, as traditional suspension techniques do not allow for efficient alteration of computing resources when tasks become unblocked, and deadlines for task completion are not effectively managed, impacting system efficiency.
Innovation Solution
The system suspends execution environments of blocked tasks, saving state information and regenerating them when dependencies are fulfilled, and associates tasks with deadlines to optimize resource usage by delaying execution until excess resources are available or the deadline is reached.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional suspension techniques are used for blocked tasks, then task execution can be paused, but computing resources cannot be efficiently altered when tasks become unblocked
Solution Approach 1:
The patent implements dynamic resource allocation by allowing execution environments to be suspended, destroyed, and regenerated based on task state. When a task is blocked, its execution environment can be suspended to free resources; when unblocked, a new environment is generated. This dynamic approach replaces static resource allocation, enabling the system to adapt resource usage to actual task needs and resolve the contradiction between productivity and adaptability.
Solution Approach 2:
The system performs preliminary actions by pre-allocating execution environments for tasks before they actually need them. Execution environments are created in advance and can be prepared while tasks are in blocked state, so that when tasks become unblocked, they can immediately utilize pre-prepared resources without waiting for environment creation. This eliminates resource allocation delays and improves both productivity and flexibility.
2Speed
If execution environments are maintained for blocked tasks, then tasks can resume quickly, but computing resources are wasted
Solution Approach 1:
The patent extracts the execution environment from the blocked task, separating the task logic from its runtime environment. When a task is blocked, its execution environment is suspended or destroyed rather than maintained. The task can then be stored in a blocked state without consuming full execution resources. When unblocked, a new or restored environment is created, allowing quick resumption without continuous resource consumption, thus resolving the contradiction between speed and energy loss.
Solution Approach 2:
The system treats execution environments as disposable short-living objects rather than permanent allocations. Execution environments are created on-demand, used for task execution, and then destroyed or suspended when tasks complete or block. This disposable approach allows rapid environment creation for unblocked tasks (ensuring quick resumption) while avoiding the continuous resource consumption of maintaining environments for blocked tasks (reducing waste).
3Speed
If tasks are executed immediately, then system responsiveness is improved, but resource allocation efficiency decreases
Solution Approach 1:
The system performs preliminary allocation of execution environments in advance, preparing resources before tasks actually execute. This allows tasks to be dispatched quickly when needed (maintaining responsiveness) while the system has already organized resources efficiently. Pre-allocation enables the system to respond immediately to task requests without ad-hoc resource gathering, improving both speed and productivity.
Solution Approach 2:
The patent implements dynamic task scheduling where execution environments are allocated based on real-time system state and task characteristics. Tasks can be queued and prepared in advance with appropriate environment allocation, allowing the system to respond quickly when tasks are submitted while optimizing resource usage based on current load and task priorities. This dynamic approach balances immediate responsiveness with efficient resource utilization.
Data Source
AI summary
Systems and methods are described for managing asynchronous code executions in an on-demand code execution system or other distributed code execution environment, in which multiple execution environments, such as virtual machine instances, can be used to enable rapid execution of user-submitted code. When asynchronous executions occur, one execution may become blocked while waiting for completion of another execution. Because the on-demand code execution system contains multiple execution environments, the system can efficiently handle a blocked execution by saving a state of the execution, and removing it from its execution environment. When a blocking dependency operation completes, the system can resume the blocked execution using the state information, in the same or different execution environment.


