STRUCTURED TASK HIERARCHY FOR A PARALLEL RUNTIME
First Claim
1. At a computer system including one or more processors and system memory, a method for executing code in accordance with a task directed acyclic graph that divides processing into tasks, the method comprising:
- an act of initiating execution of a task included in the task directed acyclic graph;
an act of spawning a plurality of concurrently executable sub-tasks during the time the task is executing, each sub-task configured to perform an indicated portion of work related to the task;
for at least one of the plurality of concurrently executable sub-tasks;
an act of attaching the sub-task as a child task of the task within the task directed acyclic graph such that the task is also the parent task of the sub-task task within the task directed acyclic graph;
an act of grouping the sub-task with any other sub-tasks attached to the task within the context of the task; and
an act of preventing completion of the task until the attached sub-task is complete;
an act of a multi-core processor concurrently executing each of the plurality of concurrently executable sub-tasks to perform the indicated portions of work related to the task, each of the plurality of concurrently executable sub-tasks concurrently executed with at least one other task at the computer system; and
upon detecting that all attached sub-tasks have completed, an act of permitting the task to complete.
2 Assignments
0 Petitions
Accused Products
Abstract
The present invention extends to methods, systems, and computer program products for a structured task hierarchy for a parallel runtime. The parallel execution runtime environment permits flexible spawning and attachment of tasks to one another to form a task hierarchy. Parent tasks can be prevented from completing until any attached child sub-tasks complete. Exceptions can be aggregated in an exception array such that any aggregated exceptions for a task are available when the task completes. A shield mode is provided to prevent tasks from attaching to another task as child tasks.
31 Citations
20 Claims
-
1. At a computer system including one or more processors and system memory, a method for executing code in accordance with a task directed acyclic graph that divides processing into tasks, the method comprising:
-
an act of initiating execution of a task included in the task directed acyclic graph; an act of spawning a plurality of concurrently executable sub-tasks during the time the task is executing, each sub-task configured to perform an indicated portion of work related to the task; for at least one of the plurality of concurrently executable sub-tasks; an act of attaching the sub-task as a child task of the task within the task directed acyclic graph such that the task is also the parent task of the sub-task task within the task directed acyclic graph; an act of grouping the sub-task with any other sub-tasks attached to the task within the context of the task; and an act of preventing completion of the task until the attached sub-task is complete; an act of a multi-core processor concurrently executing each of the plurality of concurrently executable sub-tasks to perform the indicated portions of work related to the task, each of the plurality of concurrently executable sub-tasks concurrently executed with at least one other task at the computer system; and upon detecting that all attached sub-tasks have completed, an act of permitting the task to complete. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19)
-
-
12. At a computer system including one or more processors and system memory, a method for marshaling exceptions for code executed in accordance with a task directed acyclic graph that divides processing into tasks, the method comprising:
-
an act of a portion of the code joining with execution of a task included in the task directed acyclic graph; an act of maintaining a state object providing context for the task, the state object including an exception array for storing exceptions thrown by any child sub-tasks of the task; an act of spawning a plurality of concurrently executable sub-tasks during execution of the task, each sub-task configured to perform an indicated portion of work related to the task; an act of a multi-core processor concurrently executing the plurality of concurrently executable sub-tasks to perform the portions of work related to the task; an act of the task receiving a plurality of exceptions thrown by a subset of the plurality of concurrently executable sub-tasks; an act of the task observing at least some of the plurality of exceptions within the context of the task provided by the state object; an act of aggregating remaining exceptions not observed by the task into the exception array; and an act of providing the remaining exceptions in the exception array to the portion of code that joined with execution of the task. - View Dependent Claims (13, 14, 15)
-
-
20. A computer system comprising:
-
a multi-core processor; system memory; and one or more computer storage media having stored thereon computer executable instructions representing a parallel execution runtime, the parallel execution runtime configured to; initiate execution of a task included in the task hierarchy, a state object providing context for the task; spawn a plurality of concurrently executable sub-tasks during the time the task is executing, each sub-task configured to perform an indicated portion of work related to the task; attach a subset, but not all, of the plurality of concurrently executable sub-tasks to the task as a child task of the task; prevent completion of the task until the attached subset of sub-tasks complete so that exceptions for the attached sub-tasks can be appropriately aggregated; concurrently execute each of the plurality of concurrently executable sub-tasks to perform the indicated portions of work related to the task, each of the plurality of concurrently executable sub-tasks concurrently executed with at least one other task at the computer system; receive a plurality of exceptions thrown by the subset of sub-tasks; observe at least some of the plurality of exceptions within the context of the task provided by the state object; aggregate any remaining exceptions not observed by the task into the exception array; provide the remaining exceptions in the exception array to the portion of code that joined with execution of the task; and upon detecting that all attached sub-tasks in the subset of sub-task have completed, permit the task to complete.
-
Specification