Package java.util.concurrent

Examples of java.util.concurrent.ForkJoinPool$ForkJoinWorkerThreadFactory


        long b = System.currentTimeMillis();
    //alllist = wyService.wyDataLinks("2014043", 3);
    //System.out.println("顺序执行:size:"+alllist.size()+"time:"+(System.currentTimeMillis()-b));
    //for (int i = 0; i < 5; i++) {
      b = System.currentTimeMillis();
      ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors());
      int linkPages = wyService.dataLinkPages("2014043", 3);
      DataLinkThread thread = new DataLinkThread(1,linkPages);
      thread.setTarget(thread);
          Future<List<String>> result = forkJoinPool.submit(thread);
          forkJoinPool.shutdown();
         //System.out.println("ForkJoin:size:"+result.get().size()+" time:"+(System.currentTimeMillis()-b));
    //}
       
  }
View Full Code Here


    long b = System.currentTimeMillis();
    // alllist = wyService.wyDataLinks("2014043", 3);
    // System.out.println("顺序执行:size:"+alllist.size()+"time:"+(System.currentTimeMillis()-b));
    // for (int i = 0; i < 5; i++) {
    b = System.currentTimeMillis();
    ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime()
        .availableProcessors());
    // int linkPages = wyService.dataLinkPages("2014043", 3);
    // DataLinkForkJoin thread = new DataLinkForkJoin(1,linkPages);
    // Future<List<String>> result = forkJoinPool.submit(thread);
    // forkJoinPool.shutdown();
View Full Code Here

    private final ForkJoinPool forkJoinPool;

    private PackageScanner() {
        classLoader = currentThread().getContextClassLoader();
        assert classLoader != null;
        forkJoinPool = new ForkJoinPool(getRuntime().availableProcessors());
        classFilter = Predicates.alwaysTrue();
    }
View Full Code Here

    public AsyncEventService() {
        this(Runtime.getRuntime().availableProcessors());
    }

    public AsyncEventService(int parallelism) {
        notificatorPool = new ForkJoinPool(parallelism);
    }
View Full Code Here

        }
        int threshold = size / 8;
        int nThreads = 2;
        SelectMaxProblem problem = new SelectMaxProblem(numbers, 0, size);
        MaxFJ mfj = new MaxFJ(problem, threshold);
        ForkJoinPool fjp = new ForkJoinPool(nThreads);

        final long start = System.nanoTime();
        fjp.invoke(mfj);
        final long mfjElapsed = System.nanoTime() - start;
        System.out.println("Result = " + mfj.result + ", elapsed nanos = " + mfjElapsed);

        MaxSerial serial = new MaxSerial(problem);
        final long startSerial = System.nanoTime();
View Full Code Here

TOP

Related Classes of java.util.concurrent.ForkJoinPool$ForkJoinWorkerThreadFactory

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.