- public ThreadPoolExecutor(int corePoolSize,
- int maximumPoolSize,
- long keepAliveTime,
- TimeUnit unit,
- BlockingQueue<Runnable> workQueue,
- ThreadFactory threadFactory,
- RejectedExecutionHandler handler)
- corePoolSize => 线程池核心线程数量
- maximumPoolSize => 线程池最大数量(包含核心线程数量)
- keepAliveTime => 当前线程池数量超过 corePoolSize 时,多余的空闲线程的存活时间,即多次时间内会被销毁。
- unit => keepAliveTime 的单位
- workQueue => 线程池所使用的缓冲队列,被提交但尚未被执行的任务
- threadFactory => 线程工厂,用于创建线程,一般用默认的即可
- handler => 拒绝策略,当任务太多来不及处理,如何拒绝任务
标签:Java,21,corePoolSize,keepAliveTime,maximumPoolSize,int,线程,workQueue From: https://blog.csdn.net/weixin_73330164/article/details/137132669