Java Thread Executor Create getExecutorService()

Here you can find the source of getExecutorService()

Description

get Executor Service

License

Open Source License

Declaration

private static ExecutorService getExecutorService() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    private static ExecutorService executorService;

    private static ExecutorService getExecutorService() {
        if (executorService == null) {
            executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2 + 2);
        }//from  www .  java  2 s. co  m
        return executorService;
    }
}

Related

  1. createSingleThreadExecutor(final String name)
  2. createStatisticsExecutor()
  3. createThreadFactory(final String prefix)
  4. getExecutor()
  5. getExecutor(int numTasks, int maxThreads)
  6. getExecutorService()
  7. getExecutorService()
  8. getExecutorService(int maximumPoolSize, int corePoolSize, long keepAliveTime, final String name, RejectedExecutionHandler rejectionPolicy)
  9. getExecutorService(int poolSize)