Examples of prestartAllCoreThreads()


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

            threadCount = Math.abs(threadCount) * numCpus;
        }
        ThreadFactory threadFactory = createThreadFactory(group, namePrefix);
        ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(threadCount, threadFactory);
        if (preStart) {
            executor.prestartAllCoreThreads();
        }
        return executor;
    }

    public static <F> List<F> getAllFutures(Collection<Future<F>> futureList) {
View Full Code Here

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

            threadCount = Math.abs(threadCount) * numCpus;
        }
        ThreadFactory threadFactory = createThreadFactory(group, namePrefix);
        ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(threadCount, threadFactory);
        if (preStart) {
            executor.prestartAllCoreThreads();
        }
        return executor;
    }

    @Deprecated
View Full Code Here

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

    }

    public static ScheduledExecutorService getExecutor(String namePrefix, int threadCount) {
        ExecutionPoolThreadFactory threadFactory = new ExecutionPoolThreadFactory(namePrefix);
        ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(threadCount, threadFactory);
        executor.prestartAllCoreThreads();
        return executor;
    }

    public static ScheduledExecutorService getNewExactExecutor(String namePrefix) {
        return getExecutor(namePrefix, ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors());
View Full Code Here

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

    // components.
    super.notifyAgentWithStatus(ProcessState.Initializing, processJmxUrl);

    ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(
        1);
    executor.prestartAllCoreThreads();
    // Instantiate a UIMA AS jmx monitor to poll for status of the AE.
    // This monitor checks if the AE is initializing or ready.
    UimaAEJmxMonitor monitor = new UimaAEJmxMonitor(this, serviceArgs);
    /*
     * This will execute the UimaAEJmxMonitor continuously for every 15
View Full Code Here

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

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

                    }
                });
            }

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

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

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

                    }
                });
            }

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

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

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

        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

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

                traceWorkerService();
            }
        });

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

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

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

                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
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.