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.Action  
Ops.BinaryDoubleOp  
Ops.BinaryDoublePredicate  
Ops.BinaryIntOp  
Ops.BinaryIntPredicate  
Ops.BinaryLongOp  
Ops.BinaryLongPredicate  
Ops.BinaryOp<A,B,R>  
Ops.BinaryPredicate<A,B>  
Ops.DoubleAndDoubleProcedure  
Ops.DoubleAndDoubleToInt  
Ops.DoubleAndDoubleToLong  
Ops.DoubleAndDoubleToObject<R>  
Ops.DoubleAndIntPredicate  
Ops.DoubleAndIntProcedure  
Ops.DoubleAndIntToDouble  
Ops.DoubleAndIntToInt  
Ops.DoubleAndIntToLong  
Ops.DoubleAndIntToObject<R>  
Ops.DoubleAndLongPredicate  
Ops.DoubleAndLongProcedure  
Ops.DoubleAndLongToDouble  
Ops.DoubleAndLongToInt  
Ops.DoubleAndLongToLong  
Ops.DoubleAndLongToObject<R>  
Ops.DoubleAndObjectPredicate<A>  
Ops.DoubleAndObjectProcedure<A>  
Ops.DoubleAndObjectToDouble<A>  
Ops.DoubleAndObjectToInt<A>  
Ops.DoubleAndObjectToLong<A>  
Ops.DoubleAndObjectToObject<A,R>  
Ops.DoubleComparator  
Ops.DoubleGenerator  
Ops.DoubleOp  
Ops.DoublePredicate  
Ops.DoubleProcedure  
Ops.DoubleReducer  
Ops.DoubleToInt  
Ops.DoubleToLong  
Ops.DoubleToObject<R>  
Ops.Generator<R>  
Ops.IntAndDoublePredicate  
Ops.IntAndDoubleProcedure  
Ops.IntAndDoubleToDouble  
Ops.IntAndDoubleToInt  
Ops.IntAndDoubleToLong  
Ops.IntAndDoubleToObject<R>  
Ops.IntAndIntProcedure  
Ops.IntAndIntToDouble  
Ops.IntAndIntToLong  
Ops.IntAndIntToObject<R>  
Ops.IntAndLongPredicate  
Ops.IntAndLongProcedure  
Ops.IntAndLongToDouble  
Ops.IntAndLongToInt  
Ops.IntAndLongToLong  
Ops.IntAndLongToObject<R>  
Ops.IntAndObjectPredicate<A>  
Ops.IntAndObjectProcedure<A>  
Ops.IntAndObjectToDouble<A>  
Ops.IntAndObjectToInt<A>  
Ops.IntAndObjectToLong<A>  
Ops.IntAndObjectToObject<A,R>  
Ops.IntComparator  
Ops.IntGenerator  
Ops.IntOp  
Ops.IntPredicate  
Ops.IntProcedure  
Ops.IntReducer  
Ops.IntToDouble  
Ops.IntToLong  
Ops.IntToObject<R>  
Ops.LongAndDoublePredicate  
Ops.LongAndDoubleProcedure  
Ops.LongAndDoubleToDouble  
Ops.LongAndDoubleToInt  
Ops.LongAndDoubleToLong  
Ops.LongAndDoubleToObject<R>  
Ops.LongAndIntPredicate  
Ops.LongAndIntProcedure  
Ops.LongAndIntToDouble  
Ops.LongAndIntToInt  
Ops.LongAndIntToLong  
Ops.LongAndIntToObject<R>  
Ops.LongAndLongProcedure  
Ops.LongAndLongToDouble  
Ops.LongAndLongToInt  
Ops.LongAndLongToObject<R>  
Ops.LongAndObjectPredicate<A>  
Ops.LongAndObjectProcedure<A>  
Ops.LongAndObjectToDouble<A>  
Ops.LongAndObjectToInt<A>  
Ops.LongAndObjectToLong<A>  
Ops.LongAndObjectToObject<A,R>  
Ops.LongComparator  
Ops.LongGenerator  
Ops.LongOp  
Ops.LongPredicate  
Ops.LongProcedure  
Ops.LongReducer  
Ops.LongToDouble  
Ops.LongToInt  
Ops.LongToObject<R>  
Ops.ObjectAndDoublePredicate<A>  
Ops.ObjectAndDoubleProcedure<A>  
Ops.ObjectAndDoubleToDouble<A>  
Ops.ObjectAndDoubleToInt<A>  
Ops.ObjectAndDoubleToLong<A>  
Ops.ObjectAndDoubleToObject<A,R>  
Ops.ObjectAndIntPredicate<A>  
Ops.ObjectAndIntProcedure<A>  
Ops.ObjectAndIntToDouble<A>  
Ops.ObjectAndIntToInt<A>  
Ops.ObjectAndIntToLong<A>  
Ops.ObjectAndIntToObject<A,R>  
Ops.ObjectAndLongPredicate<A>  
Ops.ObjectAndLongProcedure<A>  
Ops.ObjectAndLongToDouble<A>  
Ops.ObjectAndLongToInt<A>  
Ops.ObjectAndLongToLong<A>  
Ops.ObjectAndLongToObject<A,R>  
Ops.ObjectAndObjectProcedure<A,B>  
Ops.ObjectAndObjectToDouble<A,B>  
Ops.ObjectAndObjectToInt<A,B>  
Ops.ObjectAndObjectToLong<A,B>  
Ops.ObjectToDouble<A>  
Ops.ObjectToInt<A>  
Ops.ObjectToLong<A>  
Ops.Op<A,R>  
Ops.Predicate<A>  
Ops.Procedure<A>  
Ops.Reducer<A>  
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
AbstractParallelAnyArray Abstract class serving as the basis of parallel array classes across types.
AsyncAction Resultless ForkJoinTasks with explicit completions.
CommonOps A collection of static factory methods providing commonly useful implementations of operations.
CyclicAction A computation that is broken into a series of task executions, each separated by a Phaser 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 declaring per-element operations used within parallel methods on aggregates.
ParallelArray<T> An array supporting parallel operations.
ParallelArrayWithBounds<T> A prefix view of ParallelArray that causes operations to apply only to elements within a given range.
ParallelArrayWithDoubleMapping<T> A prefix view of ParallelArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelArrayWithFilter<T> A prefix view of ParallelArray that causes operations to apply only to elements for which a selector returns true.
ParallelArrayWithLongMapping<T> A prefix view of ParallelArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelArrayWithMapping<T,U> A prefix view of ParallelArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelDoubleArray An array of doubles supporting parallel operations.
ParallelDoubleArrayWithBounds A prefix view of ParallelDoubleArray that causes operations to apply only to elements within a given range.
ParallelDoubleArrayWithDoubleMapping A prefix view of ParallelArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelDoubleArrayWithFilter A prefix view of ParallelDoubleArray that causes operations to apply only to elements for which a selector returns true.
ParallelDoubleArrayWithLongMapping A prefix view of ParallelDoubleArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelDoubleArrayWithMapping<U> A prefix view of ParallelDoubleArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelLongArray An array of longs supporting parallel operations.
ParallelLongArrayWithBounds A prefix view of ParallelLongArray that causes operations to apply only to elements within a given range.
ParallelLongArrayWithDoubleMapping A prefix view of ParallelLongArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelLongArrayWithFilter A prefix view of ParallelLongArray that causes operations to apply only to elements for which a selector returns true.
ParallelLongArrayWithLongMapping A prefix view of ParallelLongArray that causes operations to apply to mappings of elements, not to the elements themselves.
ParallelLongArrayWithMapping<U> A prefix view of ParallelLongArray that causes operations to apply to mappings of elements, not to the elements themselves.
RecursiveAction Recursive resultless ForkJoinTasks.
RecursiveTask<V> Recursive result-bearing 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.