文件名称:JAVA线程池实验报告.docx
介绍说明--下载内容来自于网络,使用问题请自行百度
用JAVA实现一个线程池,线程池在初始状态下没有任何工作线程。当工作队列中有未执行的任务时,分一下两种情况处理:
. 如果线程池中工作线程数目为MAX_SIZE,那就什么也不做;
. 如果线程池中工作线程数目小于MAX_SIZE,那么创建一个工作线程,使它执行新任务。
对于线程池中空闲的工作线程,如果其闲置时间超过TIMEOUT秒,就销毁该线程。(A thread pool is implemented with JAVA, and the thread pool has no working thread in the initial state. When there is an un - executed task in a work queue, two cases are dealt with:
If the number of working threads in the thread pool is MAX_SIZE, then nothing will be done.
If the number of working threads in the thread pool is less than MAX_SIZE, then a working thread is created to make it perform a new task.
For the idle working thread in the thread pool, the thread is destroyed if it is idle for more than TIMEOUT seconds.)
. 如果线程池中工作线程数目为MAX_SIZE,那就什么也不做;
. 如果线程池中工作线程数目小于MAX_SIZE,那么创建一个工作线程,使它执行新任务。
对于线程池中空闲的工作线程,如果其闲置时间超过TIMEOUT秒,就销毁该线程。(A thread pool is implemented with JAVA, and the thread pool has no working thread in the initial state. When there is an un - executed task in a work queue, two cases are dealt with:
If the number of working threads in the thread pool is MAX_SIZE, then nothing will be done.
If the number of working threads in the thread pool is less than MAX_SIZE, then a working thread is created to make it perform a new task.
For the idle working thread in the thread pool, the thread is destroyed if it is idle for more than TIMEOUT seconds.)
相关搜索: java线程池
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
JAVA线程池实验报告.docx | 220832 | 2017-11-30 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.