首页 > 其他 > 详细

ScheduledThreadPoolExecutor

时间:2016-02-22 23:38:25      阅读:457      评论:0      收藏:0      [点我收藏+]

1、

技术分享

2、ScheduledThreadPoolExecutor和Timer类似,可以设定一段时间delay之后或者按照一定的rate来执行任务。

3、ScheduledThreadPoolExecutor继承自ThreadPoolExecutor,但是ThreadPoolExecutor的一些API对ScheduledThreadPoolExecutor是无效的,因为ScheduledThreadPoolExecutor本质上是一个只有coreSize大小的而且BlockingQueue为inbound的一个线程池。

a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments tomaximumPoolSize have no useful effect. Additionally, it is almost never a good idea to set corePoolSize to zero or use allowCoreThreadTimeOut because this may leave the pool without threads to handle tasks once they become eligible to run.

ScheduledThreadPoolExecutor

原文:http://www.cnblogs.com/YDDMAX/p/5208497.html

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