1.分类
ExecutorService e = Executors.newFixedThreadPool(2);
ExecutorService e1 = Executors.newCachedThreadPool();
ScheduledExecutorService e2 = Executors.newScheduledThreadPool(10);
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1,20,10000,TimeUnit.SECONDS,new LinkedBlockingQueue<>());
1.固定线程池的数量,核心线程数不会消亡。
2.可缓存的线程池的数量keepAliveTime 60s。缓存核心线程数。
3.定时任务的线程池,任务主要通过延迟队列保存。
4.线程池,我们可以自定义这些参数。
--未完待续