【并发编程】ThreadPoolExecutor参数详解
来源:互联网 发布:广告图设计软件 编辑:程序博客网 时间:2024/05/01 10:56
ThreadPoolExecutor executor = new ThreadPoolExecutor(int corePoolSize,int maximumPoolSize,long keepAliveTime,TimeUnit unit,BlockingQueue<Runnable> workQueue);
Core pool size
The lower limit of threads that are contained in the thread pool. Actually, the thread
pool starts with zero threads, but once the core pool size is reached, the number of
threads does not fall below this lower limit. If a task is added to the queue when the
number of worker threads in the pool is lower than the core pool size, a new thread
will be created even if there are idle threads waiting for tasks. Once the number of
worker threads is equal to or higher than the core pool size, new worker threads
are only created if the queue is full—i.e., queuing gets precedence over thread cre‐
ation.
Maximum pool size
The maximum number of threads that can be executed concurrently. Tasks that are
added to the queue when the maximum pool size is reached will wait in the queue
until there is an idle thread available to process the task.
Maximum idle time (keep-alive time)
Idle threads are kept alive in the thread pool to be prepared for incoming tasks to
process, but if the alive time is set, the system can reclaim noncore pool threads.
The alive time is configured in TimeUnits , the unit the time is measured in.
Task queue type
An implementation of BlockingQueue that holds
tasks added by the consumer until they can be processed by a worker thread. De‐
pending on the requirements, the queuing policy can vary.
- 【并发编程】ThreadPoolExecutor参数详解
- java并发编程—— 线程池原理 详解 ThreadPoolExecutor
- ThreadPoolExecutor 参数详解
- java并发编程之ThreadPoolExecutor
- java并发编程之ThreadPoolExecutor
- Android ThreadPoolExecutor 的参数详解
- Android线程池ThreadPoolExecutor参数详解
- java 并发编程实战 第五天 ThreadPoolExecutor 源码分析
- Java并发编程 之 线程池核心ThreadPoolExecutor
- Java并发编程:ThreadPoolExecutor类及方法源码分析
- Java并发编程:线程池的使用[ThreadPoolExecutor]
- Java并发编程:线程池的使用(ThreadPoolExecutor)
- 配置ThreadPoolExecutor(java并发编程第8章)
- 并发编程--线程池ThreadPoolExecutor实现原理(二)
- Java 并发编程(六)线程池Executors与ThreadPoolExecutor
- ThreadPoolExecutor详解
- ThreadPoolExecutor 详解
- ThreadPoolExecutor详解
- MFD还原和备份
- VC连接ACCESS数据库出现的问题
- (十)洞悉linux下的Netfilter&iptables:网络地址转换原理之SNAT
- android中模拟http协议表单上传
- C基础----控制流程
- 【并发编程】ThreadPoolExecutor参数详解
- 求圆的面积1【Java】
- Qt_OpenGL小探1
- android系统字体调到超大后显示不全
- Docker Serials 1: 安装Docker 和 编译Base Image
- Monkey源码分析番外篇之WindowManager注入事件如何跳出进程间安全限制
- Java 使用JSP页面生成随机验证码
- 如何在Android用FFmpeg+SDL2.0之同步视频
- Linux学习笔记之VI(VIM)编辑器