public abstract class TaskGraphExecutor extends Object
| Constructor and Description |
|---|
TaskGraphExecutor() |
| Modifier and Type | Method and Description |
|---|---|
static TaskGraphExecutor |
create()
Create a task graph runner that uses
Runtime.availableProcessors() threads. |
static TaskGraphExecutor |
create(int nthreads)
Create a task graph runner that uses the specified number of threads.
|
static TaskGraphExecutor |
create(int nthreads,
String name)
Create a task graph runner that uses the specified number of threads.
|
abstract <T extends Callable<?>,E> |
execute(DAGNode<T,E> graph)
Execute a task graph.
|
static TaskGraphExecutor |
singleThreaded()
Return a single-threaded task graph runner.
|
public static TaskGraphExecutor create(int nthreads, String name)
nthreads - The number of threads (at least 1).name - The name of the task executor (used to name threads)public static TaskGraphExecutor create(int nthreads)
nthreads - The number of threads (at least 1).public static TaskGraphExecutor create()
Runtime.availableProcessors() threads.public static TaskGraphExecutor singleThreaded()
public abstract <T extends Callable<?>,E> void execute(DAGNode<T,E> graph) throws ExecutionException, InterruptedException
T - The task type.E - The edge type.graph - The graph to execute.ExecutionException - If there is an error executing one or more tasks.InterruptedException - If task execution is interrupted.