Examples of RecursiveAction


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

Examples of java.util.concurrent.RecursiveAction

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

Examples of java.util.concurrent.RecursiveAction

    }

    @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

Examples of jsr166e.RecursiveAction

        for (int i = 0; i < 10; i++)
            run(COUNT);
    }

    static void run(int count) throws Exception {
        RecursiveAction lastTask = new RecursiveAction() {
            @Override
            protected void compute() {
            }
        };
        final long start = System.nanoTime();
        fjPool.submit(new MyTask(count, lastTask));
        lastTask.get();
        System.out.println("count: " + count + " time: " + TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS));
    }
View Full Code Here

Examples of jsr166y.RecursiveAction

        return new WarmUpTask(warmUpDriver, errors, copy, tasks);
    }

    private RecursiveAction newBackgroundAction()
    {
        return new RecursiveAction()
        {
            @Override
            protected void compute()
            {
                try
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.