What is the difference between corePoolSize and maxPoolSize in the Spring ThreadPoolTaskExecutor

后端 未结 6 1744
一个人的身影
一个人的身影 2020-12-08 04:17

I have to send out massEmails to all users of a website. I want to use a thread pool for each email that is sent out. Currently I have set the values to :

&l         


        
6条回答
  •  旧时难觅i
    2020-12-08 04:52

    corePoolSize is the minimum number of threads used by the pool. The number can increase up to maxPoolSize. When the load goes down, the pool will shrink back to corePoolSize.

    Sending email seems to be an I/O bound operation. I do not think having 500 threads will make it faster.

提交回复
热议问题