jsr166y.forkjoin
public interface ForkJoinExecutor
ForkJoinTask
computations. This
interface does not expose lifecycle, status, or management methods
corresponding to implementations, so may be useful as a basis
for classes that must restrict access to such methods.Modifier and Type | Method and Description |
---|---|
<T> void |
execute(ForkJoinTask<T> task)
Arranges for (asynchronous) execution of the given task.
|
int |
getParallelismLevel()
Returns an estimate of how many tasks (including subtasks)
may execute at once.
|
<T> T |
invoke(ForkJoinTask<T> task)
Performs the given task; returning its result upon completion
|
<T> java.util.concurrent.Future<T> |
submit(ForkJoinTask<T> task)
Arranges for (asynchronous) execution of the given task,
returning a Future that may be used to obtain results
upon completion.
|
<T> void execute(ForkJoinTask<T> task)
task
- the taskjava.lang.NullPointerException
- if task is nulljava.util.concurrent.RejectedExecutionException
- if the executor is
not in a state that allows execution.<T> T invoke(ForkJoinTask<T> task)
task
- the taskjava.lang.NullPointerException
- if task is nulljava.util.concurrent.RejectedExecutionException
- if the executor is
not in a state that allows execution.<T> java.util.concurrent.Future<T> submit(ForkJoinTask<T> task)
task
- the taskjava.lang.NullPointerException
- if task is nulljava.util.concurrent.RejectedExecutionException
- if the executor is
not in a state that allows execution.int getParallelismLevel()