spring 线程池 的一个坑。

问题简述:spring

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

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

同时schema描述中写道:this

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).
   。。。。。spa


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

    spring 版本:3.2.8队列

相关文章
相关标签/搜索