hunt.concurrency.ForkJoinTask

Undocumented in source.

Members

Classes

AdaptedCallable
class AdaptedCallable(T)

Adapter for Callables.

AdaptedRunnable
class AdaptedRunnable(T)

Adapter for Runnables. This implements RunnableFuture to be compliant with AbstractExecutorService constraints when used in ForkJoinPool.

AdaptedRunnableAction
class AdaptedRunnableAction

Adapter for Runnables without results.

CountedCompleter
class CountedCompleter(T)

A {@link ForkJoinTask} with a completion action performed when triggered and there are no remaining pending actions. CountedCompleters are in general more robust in the presence of subtask stalls and blockage than are other forms of ForkJoinTasks, but are less intuitive to program. Uses of CountedCompleter are similar to those of other completion based components (such as {@link java.nio.channels.CompletionHandler}) except that multiple <em>pending</em> completions may be necessary to trigger the completion action {@link #onCompletion(CountedCompleter)}, not just one. Unless initialized otherwise, the {@linkplain #getPendingCount pending count} starts at zero, but may be (atomically) changed using methods {@link #setPendingCount}, {@link #addToPendingCount}, and {@link #compareAndSetPendingCount}. Upon invocation of {@link #tryComplete}, if the pending action count is nonzero, it is decremented; otherwise, the completion action is performed, and if this completer itself has a completer, the process is continued with its completer. As is the case with related synchronization components such as {@link Phaser} and {@link Semaphore}, these methods affect only internal counts; they do not establish any further internal bookkeeping. In particular, the identities of pending tasks are not maintained. As illustrated below, you can create subclasses that do record some or all pending tasks or their results when needed. As illustrated below, utility methods supporting customization of completion traversals are also provided. However, because CountedCompleters provide only basic synchronization mechanisms, it may be useful to create further abstract subclasses that maintain linkages, fields, and additional support methods appropriate for a set of related usages.

ForkJoinTask
class ForkJoinTask(V)

Abstract base class for tasks that run within a {@link ForkJoinPool}. A {@code ForkJoinTask} is a thread-like entity that is much lighter weight than a normal thread. Huge numbers of tasks and subtasks may be hosted by a small number of actual threads in a ForkJoinPool, at the price of some usage limitations.

RecursiveTask
class RecursiveTask(V)

A recursive result-bearing {@link ForkJoinTask}.

RunnableExecuteAction
class RunnableExecuteAction

Adapter for Runnables in which failure forces worker exception.

Interfaces

ICountedCompleter
interface ICountedCompleter

Meta