Package jsr166y.forkjoin

A fine-grained parallel computation framework.

See:
          Description

Interface Summary
ForkJoinExecutor An object that executes ForkJoinTask computations.
ForkJoinPool.ForkJoinWorkerThreadFactory Factory for creating new ForkJoinWorkerThreads.
Ops.Combiner<T,U,V> An object with a function accepting pairs of objects, one of type T and one of type U, returning those of type V
Ops.DoubleComparator A Comparator for doubles
Ops.DoubleGenerator A generator of doubles
Ops.DoubleMapper A mapper accepting a double argument and returning a double
Ops.DoublePredicate A predicate accepting a double argument
Ops.DoubleProcedure A procedure accepting a double
Ops.DoubleReducer A reducer accepting and returning doubles
Ops.DoubleRelationalPredicate A relationalPredicate accepting double arguments
Ops.Generator<T> A generator (builder) of objects of type T that takes no arguments.
Ops.IntComparator A Comparator for ints
Ops.IntGenerator A generator of ints
Ops.IntMapper A map accepting an int and returning an int
Ops.IntPredicate A predicate accepting an int
Ops.IntProcedure A procedure accepting an int
Ops.IntReducer A reducer accepting and returning ints
Ops.IntRelationalPredicate A relationalPredicate accepting int arguments
Ops.LongComparator A Comparator for longs
Ops.LongGenerator A generator of longs
Ops.LongMapper A mapper accepting a long argument and returning a long
Ops.LongPredicate A predicate accepting a long argument
Ops.LongProcedure A procedure accepting a long
Ops.LongReducer A reducer accepting and returning longs
Ops.LongRelationalPredicate A relationalPredicate accepting long arguments
Ops.Mapper<T,U> An object with a function accepting objects of type T and returning those of type U
Ops.MapperFromDouble<T> A mapper accepting a double
Ops.MapperFromDoubleToInt A mapper accepting a double argument and returning an int
Ops.MapperFromDoubleToLong A mapper accepting a double argument and returning a long
Ops.MapperFromInt<T> A mapper accepting an int
Ops.MapperFromIntToDouble A mapper accepting an int argument and returning a double
Ops.MapperFromIntToLong A mapper accepting an int argument and returning a long
Ops.MapperFromLong<T> A mapper accepting a long argument
Ops.MapperFromLongToDouble A mapper accepting a long argument and returning a double
Ops.MapperFromLongToInt A mapper accepting a long argument and returning an int
Ops.MapperToDouble<T> A mapper returning a double
Ops.MapperToInt<T> A mapper returning an int
Ops.MapperToLong<T> A mapper returning a long
Ops.Predicate<T> An object with boolean method of one argument
Ops.Procedure<T> An object with a method of one argument that does not return a result.
Ops.Reducer<T> A specialized combiner that is associative and accepts pairs of objects of the same type and returning one of the same type.
Ops.RelationalPredicate<T,U> An object with boolean method of two arguments
ParallelArray.SummaryStatistics<T> Summary statistics for a possibly bounded, filtered, and/or mapped ParallelArray.
ParallelDoubleArray.SummaryStatistics Summary statistics for a possibly bounded, filtered, and/or mapped ParallelDoubleArray.
ParallelLongArray.SummaryStatistics Summary statistics for a possibly bounded, filtered, and/or mapped ParallelLongArray.
 

Class Summary
AsyncAction Resultless ForkJoinTasks with explicit completions.
CyclicAction A computation that is broken into a series of task executions, each separated by a TaskBarrier arrival.
ForkJoinPool Host for a group of ForkJoinWorkerThreads that perform ForkJoinTasks.
ForkJoinPool.DefaultForkJoinWorkerThreadFactory The default ForkJoinWorkerThreadFactory, used unless overridden in ForkJoinPool constructors.
ForkJoinTask<V> Abstract base class for tasks that run within a ForkJoinPool.
ForkJoinWorkerThread A thread that is internally managed by a ForkJoinPool to execute ForkJoinTasks.
LinkedAsyncAction Resultless ForkJoinTasks with explicit completions, that may be linked in parent-child relationships.
Ops Interfaces and utilities describing per-element operations used within parallel methods on aggregates.
ParallelArray<T> An array supporting parallel operations.
ParallelArray.WithBounds<T> A restriction of parallel array operations to apply only within a given range of indices.
ParallelArray.WithDoubleMapping<T> A modifier for parallel array operations to apply to mappings of elements to doubles, not to the elements themselves
ParallelArray.WithFilter<T> A restriction of parallel array operations to apply only to elements for which a selector returns true
ParallelArray.WithLongMapping<T> A modifier for parallel array operations to apply to mappings of elements to longs, not to the elements themselves
ParallelArray.WithMapping<T,U> A modifier for parallel array operations to apply to mappings of elements, not to the elements themselves
ParallelDoubleArray An array of doubles supporting parallel operations.
ParallelDoubleArray.WithBounds A restriction of parallel array operations to apply only within a given range of indices.
ParallelDoubleArray.WithDoubleMapping A modifier for parallel array operations to apply to mappings of elements to doubles, not to the elements themselves
ParallelDoubleArray.WithFilter A restriction of parallel array operations to apply only to elements for which a selector returns true
ParallelDoubleArray.WithLongMapping A modifier for parallel array operations to apply to mappings of elements to longs, not to the elements themselves
ParallelDoubleArray.WithMapping<U> A modifier for parallel array operations to apply to mappings of elements, not to the elements themselves
ParallelLongArray An array of longs supporting parallel operations.
ParallelLongArray.WithBounds A restriction of parallel array operations to apply only within a given range of indices.
ParallelLongArray.WithDoubleMapping A modifier for parallel array operations to apply to mappings of elements to doubles, not to the elements themselves
ParallelLongArray.WithFilter A restriction of parallel array operations to apply only to elements for which a selector returns true
ParallelLongArray.WithLongMapping A modifier for parallel array operations to apply to mappings of elements to longs, not to the elements themselves
ParallelLongArray.WithMapping<U> A modifier for parallel array operations to apply to mappings of elements, not to the elements themselves
RecursiveAction Recursive resultless ForkJoinTasks.
RecursiveTask<V> Recursive result-bearing ForkJoinTasks.
TaskBarrier A synchronization barrier for ForkJoinTasks.
 

Package jsr166y.forkjoin Description

A fine-grained parallel computation framework. ForkJoinTasks and their related support classes provide a very efficient basis for obtaining platform-independent parallel speed-ups of computation-intensive operations. They are not a full substitute for the kinds of arbitrary processing supported by Executors or Threads. However, when applicable, they typically provide significantly greater performance on multiprocessor platforms.

Candidates for fork/join processing mainly include those that can be expressed using parallel divide-and-conquer techniques: To solve a problem, break it in two (or more) parts, and then solve those parts in parallel, continuing on in this way until the problem is too small to be broken up, so is solved directly. The underlying work-stealing framework makes subtasks available to other threads (normally one per CPU), that help complete the tasks. In general, the most efficient ForkJoinTasks are those that directly implement this algorithmic design pattern.

While direct implementation of parallel divide-and-conquer algorithms is often straightforward, it can also be tedious and code-intensive. For this reason, a number of solution "templates" are available for common kinds of operations on lists and arrays: applying some operation to all elements, combining elements according to some function, and so on. In this preliminary release, these are presented via some interfaces describing the associated code bodies in TaskTypes, along with an evolving set of implementations for lists and arrays of objects and scalars.