Using stages to handle dependencies in parallel tasks
AssigneeMicrosoft Corporation
InventorMario Mendes de Oliveira Zimmermann
Life of this patent
Estimating the term…
Abstract
Technologies are described herein for using stages for managing dependencies between tasks executed in parallel. A request for permission to execute a task from a group or batch of tasks is received. The specified task is retrieved from a task definition list defining a task ID, stage, and maximum stage for each task in the group. If another pending or currently running task exists with a stage and maximum stage less than the stage defined for the retrieved task, then the retrieved task is not allowed to run. If no other pending or currently running task exists with a stage and maximum stage less than the stage defined for the retrieved task, then the permission to execute the specified task is given.
Claims20
A computer-implemented method for managing execution of a plurality of tasks in a computer system, the method comprising executing instructions in the computer system to perform the operations of:
- loading a task definition list comprising tuples defining the plurality of tasks, each task in the plurality of tasks having an associated stage and a maximum stage indicating a maximum stage of execution that can be executed in parallel with the task, wherein each task is assigned to one stage and each stage contains one or more tasks;
- receiving a specified task to be executed, the specified task having an associated stage;
- determining whether another pending or currently running task in the plurality of tasks exists with an associated stage less than the stage associated with the specified task and an associated maximum stage less than the stage associated with the specified task;
- upon determining that another pending or currently running task does exist with an associated stage less than the stage associated with the specified task and an associated maximum stage less than the stage associated with the specified task, preventing the specified task from executing;
- and
- upon determining that another pending or currently running task does not exist with an associated stage less than the stage associated with the specified task and an associated maximum stage less than the stage associated with the specified task, allowing the specified task to execute.
A computer-readable storage medium encoded with computer-executable instructions that, when executed by a computer, cause the computer to:
- receive a request for permission to execute a task;
- retrieve the task from a task definition list defining a plurality of tasks, each task in the plurality of tasks having an associated stage and a maximum stage indicating a maximum stage of execution that can be executed in parallel with the task, wherein each task is assigned to one stage and each stage contains one or more tasks;
- determine whether another pending or currently running task exists with an associated stage less than the stage associated with the retrieved task and an associated maximum stage less than the stage associated with the retrieved task;
- upon determining that another pending or currently running task does exist with an associated stage less than the stage associated with the retrieved task and an associated maximum stage less than the stage associated with the retrieved task, respond to the request with an indication that the task may not be executed;
- and
- upon determining that another pending or currently running task does not exist with an associated stage less than the stage associated with the retrieved task and an associated maximum stage less than the stage associated with the retrieved task, respond to the request with an indication that the task may be executed.
A system for managing execution of a plurality of tasks, the system comprising:
- one or more processors;
- and
- a memory coupled to the one or more processors and containing a task dependencies management module configured to
- receive a request to execute a first task,
- retrieve a stage associated with the first task from a task definition list defining a plurality of tasks, each task in the plurality of tasks having an associated stage and a maximum stage indicating a maximum stage of execution that can be executed in parallel with the task, wherein each task is assigned to one stage and each stage contains one or more tasks,
- determine whether another pending or currently running task exists with an associated maximum stage less than the stage associated with the first task,
- upon determining that another pending or currently running task does exist with an associated maximum stage less than the stage associated with the first task, prevent the first task from executing, and
- upon determining that another pending or currently running task does not exist with an associated maximum stage less than the stage associated with the first task, allow the first task to be executed.
Dependencies are inferred from the claim text.