Package for parallel patterns and concurrent data structures

Through this new "Parallel Infrastructure" new parallel algorithms could be implemented very simple. This framework provides simple parallel patterns for task parallel programming:

The class Parallel provides for each parallel pattern a simple interface.

Example

Parallel.For(new BlockedRange1D(0, 10, 1), new PForTask() {
  public void execute(BlockedRange range) {
    for(int i = range.start(); i < range.end(); i++) { System.out.println(i); }
}});

parallel for

The parallel for loops base is PForJob. The body implements a class that extends PForTask. The number of iterations is given by a BlockedRange (1- and 2-dimensional). The BlockedRange has three (1D) or six (2D) parameter. These parameters define a start and a end value of the for loops. The programmer could also define a grain size for each task.

parallel reduce

The parallel reduce is based on parallel for. The PReduceJob returns with an aggregated result of all tasks. A class which extends the PReduceTask has override the reduce method.

parallel while

The parallel while iterates while there are elements in the task pool.