码迷,mamicode.com
首页 > 编程语言 > 详细

spring 线程池 的一个坑。

时间:2015-03-06 17:30:55      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:

问题简述:

配置的队列初始化的消费者线程占满了线程池。导致其他的再使用此线程池中线程不运行。不报错,不抛异常。线程的数量仅为为线程池的配置中的最小值。

<task:executor pool-size="100-150" queue-capacity="250" >

同时schema描述中写道:

The size of the executor‘s thread pool as either a single value or a range
    (e.g. 5-10). If no bounded queue-capacity value is provided, then a max value
    has no effect unless the range is specified as 0-n. In that case
, the core pool
    will have a size of n, but the ‘allowCoreThreadTimeout‘ flag will be set to true.
    If a queue-capacity is provided, then the lower bound of a range will map to the
    core size and the upper bound will map to the max size. If this attribute is not
    provided, the default core size will be 1, and the default max size will be
    Integer.MAX_VALUE (i.e. unbounded).
   。。。。。


后来解决办法:赶紧调大了线程池的数量。

    spring 版本:3.2.8


spring 线程池 的一个坑。

标签:

原文地址:http://my.oschina.net/u/1466553/blog/383443

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!