mirror of
				https://github.com/luoye663/e5.git
				synced 2025-10-26 08:55:25 +00:00 
			
		
		
		
	Merge branch 'master' into dev
This commit is contained in:
		| @@ -38,6 +38,12 @@ public class Start { | |||||||
|     @Value("${e5.system.threadPool}") |     @Value("${e5.system.threadPool}") | ||||||
|     Integer poolSize; |     Integer poolSize; | ||||||
|  |  | ||||||
|  |     @Value("${e5.system.maximumPoolSize}") | ||||||
|  |     int maximumPoolSize; | ||||||
|  |  | ||||||
|  |     @Value("${e5.system.blockingQueueSize}") | ||||||
|  |     int blockingQueueSize; | ||||||
|  |  | ||||||
|     @Value("${isdebug:true}") |     @Value("${isdebug:true}") | ||||||
|     private boolean isdebug; |     private boolean isdebug; | ||||||
|  |  | ||||||
| @@ -50,16 +56,16 @@ public class Start { | |||||||
|         // log.info("清空redis...... "); |         // log.info("清空redis...... "); | ||||||
|         // redisUtil.delAll(); |         // redisUtil.delAll(); | ||||||
|         threadPool = new ThreadPoolExecutor( |         threadPool = new ThreadPoolExecutor( | ||||||
|                 //指定了线程池中的线程数量,它的数量决定了添加的任务是开辟新的线程去执行,还是放到workQueue任务队列中去; |                 //要保留在池中的线程数,即使它们处于空闲状态,除非设置了 allowCoreThreadTimeOut | ||||||
|                 poolSize, |                 poolSize, | ||||||
|                 //指定了线程池中的最大线程数量,这个参数会根据你使用的workQueue任务队列的类型,决定线程池会开辟的最大线程数量; |                 //池中允许的最大线程数 | ||||||
|                 poolSize, |                 maximumPoolSize, | ||||||
|                 //当线程池中空闲线程数量超过corePoolSize时,多余的线程会在多长时间内被销毁; |                 //当线程池中空闲线程数量超过corePoolSize时,多余的线程会在多长时间内被销毁;当线程数大于核心时,这是多余的空闲线程在终止之前等待新任务的最长时间。 | ||||||
|                 0, |                 0, | ||||||
|                 //unit:keepAliveTime的单位 |                 //unit:keepAliveTime的单位 | ||||||
|                 TimeUnit.MILLISECONDS, |                 TimeUnit.MILLISECONDS, | ||||||
|                 //任务队列,被添加到线程池中,但尚未被执行的任务;它一般分为直接提交队列、有界任务队列、无界任务队列、优先任务队列几种; |                 //任务队列,被添加到线程池中,但尚未被执行的任务;它一般分为直接提交队列、有界任务队列、无界任务队列、优先任务队列几种; | ||||||
|                 new LinkedBlockingQueue<>(poolSize), // 有界队列 |                 new LinkedBlockingQueue<>(blockingQueueSize), // 有界队列 | ||||||
|                 //线程工厂,用于创建线程,一般用默认即可; new CustThreadFactory(), |                 //线程工厂,用于创建线程,一般用默认即可; new CustThreadFactory(), | ||||||
|                 Executors.defaultThreadFactory(), |                 Executors.defaultThreadFactory(), | ||||||
|                 //拒绝策略;当任务太多来不及处理时,如何拒绝任务; |                 //拒绝策略;当任务太多来不及处理时,如何拒绝任务; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user