Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor.prestartAllCoreThreads()


  public static ThreadPoolExecutor getThreadPoolExecutor() {
    ThreadPoolExecutor executor;
    int nbcpu = Runtime.getRuntime().availableProcessors();
    executor = new ThreadPoolExecutor(nbcpu, 2 * nbcpu, 1,
        TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
    executor.prestartAllCoreThreads();
    executor.allowCoreThreadTimeOut(true);
    return executor;
  }

  /**
 
View Full Code Here


                    }
                });
            }

            long startTime = System.nanoTime();
            executor.prestartAllCoreThreads();

            try {
                latch.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
View Full Code Here

                    }
                });
            }

            long startTime = System.nanoTime();
            executor.prestartAllCoreThreads();

            try {
                latch.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
View Full Code Here

        log.info("Start testing");



        ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(TEST_THREADS);
        executor.prestartAllCoreThreads();
        for (int i = 0; i < TEST_LOOPS; i++) {
            executor.submit(new SimulateTask());
        }

View Full Code Here

                traceWorkerService();
            }
        });

        // Ensure that core threads act like a minimum number of threads
        result.prestartAllCoreThreads();
        return result;
    }

    /**
     * Finish stopping the helper.
View Full Code Here

                public Thread newThread(Runnable r) {
                    return new Thread(r, "ClientPool");
                }
               
            });
        workerPool.prestartAllCoreThreads();

        BenchmarkWorker[] workers = new BenchmarkWorker[config.getThreads()];
        for (int i = 0; i < workers.length; i++) {
            workers[i] = new BenchmarkWorker(
                    params,
View Full Code Here

        public void rejectedExecution(Runnable r,
              ThreadPoolExecutor executor) {
      logger.warn("Rejected execution of {} by executor with {} current threads in the pool", r.getClass().getName(), executor.getPoolSize());
        }
    });
  tpRemotingExecutorService.prestartAllCoreThreads();
  remotingExecutorService = tpRemotingExecutorService;

        eventProcessor = new EventProcessor();
        eventProcessor.start();
View Full Code Here

                public Thread newThread(Runnable r) {
                    return new Thread(r, "ClientPool");
                }
               
            });
        workerPool.prestartAllCoreThreads();

        BenchmarkWorker[] workers = new BenchmarkWorker[threads];
        for (int i = 0; i < threads; i++) {
            workers[i] = new BenchmarkWorker(
                    params,
View Full Code Here

                public Thread newThread(Runnable r) {
                    return new Thread(r, "ClientPool");
                }
               
            });
        workerPool.prestartAllCoreThreads();

        BenchmarkWorker[] workers = new BenchmarkWorker[threads];
        for (int i = 0; i < threads; i++) {
            workers[i] = new BenchmarkWorker(
                    params,
View Full Code Here

                public Thread newThread(Runnable r) {
                    return new Thread(r, "ClientPool");
                }
               
            });
        workerPool.prestartAllCoreThreads();

        BenchmarkWorker[] workers = new BenchmarkWorker[threads];
        for (int i = 0; i < threads; i++) {
            workers[i] = new BenchmarkWorker(
                    params,
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.