/**
* Returns an {@link ExecutorService} that executes submitted tasks on the current thread. This executor service does not support being
* shutdown.
*
* @return an {@link ExecutorService} that executes submitted tasks on the current thread
*/
public static ExecutorService newDirectExecutorService() {
return DIRECT_EXECUTOR_SERVICE;
}
2 个回复
rochy - rochy_he
赞同来自: zhangg7723
direct
此类线程是一种不支持关闭的线程,就意味着一旦使用,则会一直存活下去.
fixed
此类线程池拥有固定数量的线程来处理请求,在没有空闲线程时请求将被挂在队列中(可选配)
scaling
此类线程池拥有的线程数量是动态的。这个数字介于core和max参数的配置之间变化
kennywu76 - Wood
赞同来自: