线程池创建
2021-01-03 04:29
标签:stat lin runnable spec time daemon block pool navig 线程池创建 标签:stat lin runnable spec time daemon block pool navig 原文地址:https://www.cnblogs.com/wanhua-wu/p/12991668.html static final int poolSize = 50;
static final long keepAliveTime = 0L;
static final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("Thread-pool-MlanguageNavigationAspect-%d").setDaemon(true).build();
static final ExecutorService executorService = new ThreadPoolExecutor(
poolSize,
poolSize,
keepAliveTime,
TimeUnit.MILLISECONDS,
//无界队列 LinkedBlockingQueue
//有界队列 ArrayBlockingQueue PriorityBlockingQueue
//同步移交 SynchronousQueue
new LinkedBlockingQueue