我正在使用Executors.newScheduledThreadPool()
来创建一个ScheduledExecutorService
,并指定线程数:
int corePoolSize = 42;
ScheduledExecutorService foo = Executors.newScheduledThreadPool(corePoolSize);
根据JavaDocs,corePoolSize
参数设置了线程池中保留的线程数,即使它们是空闲的。这是否意味着这个ExecutorService
实现可能根据需要创建超过corePoolSize
线程,类似于cached thread pool?