Package java.util.concurrent

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


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

            });
        workerPool.prestartAllCoreThreads();

        SocketFactory socketFactory = null;
        if ("https".equals(host.getSchemeName())) {
            TrustManager[] trustManagers = null;
            if (config.isDisableSSLVerification()) {
View Full Code Here

    System.out.println( "Totaltime Search = " + measureSearch );
  }

  public long measure(boolean plainLucene) throws Exception {
    ThreadPoolExecutor threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool( SEARCH_THREADS );
    threadPool.prestartAllCoreThreads();
    CountDownLatch startSignal = new CountDownLatch(1);
    List<SearcherThread> threadsList = new ArrayList<SearcherThread>( TOTAL_SEARCHES );
    IndexSearcher indexSearcher = getNewSearcher();
    for (int i = 0; i < TOTAL_SEARCHES; i++) {
      // Create a thread and invoke it
View Full Code Here

      final int nbrOfClassesPerThread = 10;
      for ( int i = 0; i < nbrOfThread; i++ ) {
        runnables.add( new DoAddClasses( sf, i, nbrOfClassesPerThread ) );
      }
      final ThreadPoolExecutor poolExecutor = Executors.newFixedThreadPool( nbrOfThread, "SFI classes addition" );
      poolExecutor.prestartAllCoreThreads();
      for ( Runnable runnable : runnables ) {
        poolExecutor.execute( runnable );
      }
      poolExecutor.shutdown();
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 Thread newThread(Runnable r) {
                    return new Thread(r, "ClientPool");
                }

            });
        workerPool.prestartAllCoreThreads();

        SocketFactory socketFactory = null;
        if ("https".equals(host.getSchemeName())) {
            TrustManager[] trustManagers = null;
            if (config.isDisableSSLVerification()) {
View Full Code Here

            if (allowCoreThreadTimeout) {
                threadPoolExecutor.allowCoreThreadTimeOut(true);
            }
            if (prestartAllCoreThreads) {
                threadPoolExecutor.prestartAllCoreThreads();
            }
            executorService = threadPoolExecutor;
            return;
        }
View Full Code Here

        if(allowCoreThreadTimeout) {
            result.allowCoreThreadTimeOut(true);
        }
        if (preStartAllCoreThreads) {
            result.prestartAllCoreThreads();
        }

        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("Created " + result.toString());
View Full Code Here

                public Thread newThread(final Runnable r) {
                    return new Thread(r, "ClientPool");
                }

            });
        workerPool.prestartAllCoreThreads();

        SocketFactory socketFactory = null;
        if ("https".equals(host.getSchemeName())) {
            TrustManager[] trustManagers = null;
            if (config.isDisableSSLVerification()) {
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

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.