关于线程池

很多时候需要用多线程做处理,但是又不想自己管理线程的启动等管理,最好的办法是委托给现成的线程池来处理。

spring提供了线程池,bean配置如下:

<bean id="mailTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="3"/>
        <property name="maxPoolSize" value="10"/>
    </bean>

 

详细使用方法参见:http://www.cnblogs.com/killbug/archive/2013/03/18/2966889.html

 

posted @ 2013-03-19 08:56  无尘24  阅读(123)  评论(0编辑  收藏  举报