是单任务线程池。另外其他创建java线程池方式还有:
1、固定大小线程池
ExecutorService pool = Executors.newFixedThreadPool(2);
pool.execute(t1);
pool.shutdown();
2、单任务线程池
ExecutorService pool = Executors.newSingleThreadExecutor();
3、可变尺寸线程池
ExecutorService pool = Executors.newCachedThreadPool();
我想到的,还有查了查资料,我就知道这么多,希望对您有帮助。 |