Package java.util.concurrent

Examples of java.util.concurrent.RecursiveAction


    ImageIO.write(image, "png", new File(new Date().getTime() + ".png"));
  }

  public void execute(final double parts) {

    fjPool.invoke(new RecursiveAction() {
     
      /**
       *
       */
      private static final long serialVersionUID = 1L;
View Full Code Here


public class Lancher {
    public static void main(String[] args) {
        long[] anArray = new long[100000];
        for (int i = 0; i < anArray.length - 1; i++)
            anArray[i] = i;
        RecursiveAction mainTask = new IncrementTask(anArray, 0, anArray.length);
        ForkJoinPool mainPool = new ForkJoinPool();
        mainPool.invoke(mainTask);
    }
View Full Code Here

    }

    @Benchmark
    public int[] parallelSort() {
        int[] array = setup();
        RecursiveAction sort = new PartialParallelSort(array, 0, array.length);

        pool.invoke(sort);
        Arrays.sort(array); //needs a second round to sort the whole array

        return array;
View Full Code Here

TOP

Related Classes of java.util.concurrent.RecursiveAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.