首页 > 编程语言 > 详细

Java线程池使用

时间:2017-01-13 12:47:57      阅读:197      评论:0      收藏:0      [点我收藏+]

1.构造函数 

public ThreadPoolExecutor(int corePoolSize,
                  int maximumPoolSize,
                  long keepAliveTime,
                  TimeUnit unit,
                  BlockingQueue<Runnable> workQueue,
                  ThreadFactory threadFactory)

corePoolSize -

maximumPoolSize - 线程池中允许的最大线程数

keepAliveTime - when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.

unit - the time unit for the keepAliveTime argument

workQueue - 工作队列,当corePoolSize达到最大值时,提交的线程保存在工作队列

Factory - 创建线程的工程

Java线程池使用

原文:http://www.cnblogs.com/zjxbeta/p/6282261.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!