多线程 - java 使用current包固定线程池对象,如何动态伸缩?
PHPz
PHPz 2017-04-18 10:05:04
0
1
690
PHPz
PHPz

学习是最好的投资!

reply all(1)
小葫芦

There seems to be no method... Executors is just a thread pool tool class that uses factory methods. FixThreadPool, CachedThreadPool, etc. are all based on thread pools that handle a certain or special situation, so they do not support setting parameters. They can only Improve performance by monitoring the status of the computer to set different values;
If you must dynamically scale, it is recommended to inherit the ThreadPoolExecutor class yourself, rewrite the beforeExecute, afterExecute, terminated methods, and use the set methods of coreSize, maxinumSize, and keepalivetime to make dynamic adjustments.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template