文件名称:JAVA线程池实验报告.docx
- 所属分类:
- JSP源码/Java
- 资源属性:
- 上传时间:
- 2017-12-27
- 文件大小:
- 215kb
- 下载次数:
- 0次
- 提 供 者:
- 阿***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
用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 |