Java Thread Executor Pool createPool(int threads, int queueSize)

Here you can find the source of createPool(int threads, int queueSize)

Description

create Pool

License

Open Source License

Declaration

static ExecutorService createPool(int threads, int queueSize) 

Method Source Code

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

import java.util.concurrent.*;

public class Main {
    static ExecutorService createPool(int threads, int queueSize) {
        return new ThreadPoolExecutor(1, threads, 30, TimeUnit.SECONDS, new LinkedBlockingDeque<>(queueSize),
                new ThreadPoolExecutor.CallerRunsPolicy());
    }/*from  w w  w . j  a v  a 2 s  . c o  m*/
}

Related

  1. clearPreloadThreads()
  2. createBoundedCachedThreadPool( final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit timeUnit)
  3. createClientThreadPool(int numThreads, int queueSize)
  4. createPooledExecutorService(int poolSize, final String namePrefix)
  5. getPool()
  6. getPool()
  7. getQueuedThreadPool(double threadToCpuRatio, int queueCapacity)