< prev index next >

test/jdk/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java

Print this page
rev 51731 : imported patch 8210732


  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  */
  22 
  23 /*
  24  * This file is available under and governed by the GNU General Public
  25  * License version 2 only, as published by the Free Software Foundation.
  26  * However, the following notice accompanied the original version of this
  27  * file:
  28  *
  29  * Written by Doug Lea with assistance from members of JCP JSR-166
  30  * Expert Group and released to the public domain, as explained at
  31  * http://creativecommons.org/publicdomain/zero/1.0/
  32  */
  33 
  34 /*
  35  * @test
  36  * @bug 4965960
  37  * @summary  Exercise ExecutorCompletionService
  38  * @library /lib/testlibrary/
  39  */
  40 
  41 import static java.util.concurrent.TimeUnit.MILLISECONDS;
  42 
  43 import java.util.concurrent.Callable;
  44 import java.util.concurrent.ExecutorCompletionService;
  45 import java.util.concurrent.ExecutorService;
  46 import java.util.concurrent.Executors;
  47 import jdk.testlibrary.Utils;
  48 
  49 public class ExecutorCompletionServiceLoops {
  50     static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
  51     static final int POOLSIZE = 10;
  52     static final ExecutorService pool =
  53         Executors.newFixedThreadPool(POOLSIZE);
  54     static final ExecutorCompletionService<Integer> ecs =
  55         new ExecutorCompletionService<>(pool);
  56     static boolean print = false;
  57 
  58     public static void main(String[] args) throws Exception {
  59         int max = 8;
  60         int base = 2000;
  61 
  62         if (args.length > 0)
  63             max = Integer.parseInt(args[0]);
  64 
  65         System.out.println("Warmup...");
  66         oneTest(base);
  67         print = true;




  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  */
  22 
  23 /*
  24  * This file is available under and governed by the GNU General Public
  25  * License version 2 only, as published by the Free Software Foundation.
  26  * However, the following notice accompanied the original version of this
  27  * file:
  28  *
  29  * Written by Doug Lea with assistance from members of JCP JSR-166
  30  * Expert Group and released to the public domain, as explained at
  31  * http://creativecommons.org/publicdomain/zero/1.0/
  32  */
  33 
  34 /*
  35  * @test
  36  * @bug 4965960
  37  * @summary  Exercise ExecutorCompletionService
  38  * @library /test/lib
  39  */
  40 
  41 import static java.util.concurrent.TimeUnit.MILLISECONDS;
  42 
  43 import java.util.concurrent.Callable;
  44 import java.util.concurrent.ExecutorCompletionService;
  45 import java.util.concurrent.ExecutorService;
  46 import java.util.concurrent.Executors;
  47 import jdk.test.lib.Utils;
  48 
  49 public class ExecutorCompletionServiceLoops {
  50     static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
  51     static final int POOLSIZE = 10;
  52     static final ExecutorService pool =
  53         Executors.newFixedThreadPool(POOLSIZE);
  54     static final ExecutorCompletionService<Integer> ecs =
  55         new ExecutorCompletionService<>(pool);
  56     static boolean print = false;
  57 
  58     public static void main(String[] args) throws Exception {
  59         int max = 8;
  60         int base = 2000;
  61 
  62         if (args.length > 0)
  63             max = Integer.parseInt(args[0]);
  64 
  65         System.out.println("Warmup...");
  66         oneTest(base);
  67         print = true;


< prev index next >