Java tutorial
//package com.java2s; import java.util.concurrent.*; public class Main { @Deprecated public static ExecutorService newFixedThreadPool(int nThreads) { ThreadPoolExecutor exec = new ThreadPoolExecutor(nThreads, nThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(nThreads)); exec.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return exec; } }