多線程的一些例子

1)

<bean id="replayParallelConsumerTaskExecutor" 

class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">

<property name="corePoolSize" value="${frcst.replay.parallel.thread.size}"/>

<property name="maxPoolSize" value="${frcst.replay.parallel.thread.size}"/>

<property name="queueCapacity" value="1"/>

</bean>

for(int i=0;i<parallelThreadSize;i++){

this.replayParallelConsumerTaskExecutor.execute(new AdjustmentReplayRequestConsumer(...)); }[consumer exteds from Thread ]


2)




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章