List several thread pool implementations:
[1] executorservice
Http://www.gznc.edu.cn/yxsz/jjglxy/book/Java_api/java/util/concurrent/ExecutorService.html
[2] scheduledexecutorservice
Http://www.gznc.edu.cn/yxsz/jjglxy/book/Java_api/java/util/concurrent/ScheduledExecutorService.html
[3] threadpoolexecutor
Http://www.gznc.edu.cn/yxsz/jjglxy/book/Java_api/java/util/concurrent/ThreadPoolExecutor.html
[4] scheduledthreadpoolexecutor
Http://www.gznc.edu.cn/yxsz/jjglxy/book/Java_api/java/util/concurrent/ScheduledThreadPoolExecutor.html
public static void main(String[] args) {
// Create a thread pool that can reuse a set of fixed threads and run these threads in a shared unbounded queue mode.
ExecutorService pool1 = Executors.newFixedThreadPool(3);
// Create a thread pool where new threads can be created as needed, but they will be reused when previously constructed threads are available
ExecutorService pool2 = Executors.newCachedThreadPool();
// Create an executor that uses a single worker thread and runs this thread in the unbounded queue mode.
ExecutorService pool3 = Executors.newSingleThreadExecutor();
// Create a thread pool, which can be scheduled to run commands after a given delay or regularly run
ScheduledExecutorService pool4 = Executors.newScheduledThreadPool(3);
// Create a single-threaded execution program, which can be scheduled to run commands after a given delay or regularly run
ScheduledExecutorService pool5 = Executors.newSingleThreadScheduledExecutor();
// Create a scalable Thread Pool
ThreadPoolExecutor pool6 = new ThreadPoolExecutor(3, 5, 3,
TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(3), new ThreadPoolExecutor.DiscardOldestPolicy());
// Create a scalable thread pool that can be scheduled to run commands after a given delay or regularly run
ScheduledThreadPoolExecutor pool7 = new ScheduledThreadPoolExecutor(5);
}