Commit 1bbabd3d by liuyu

2024/07/04 ai标注线程池调整队列大小

parent 387558d6
...@@ -44,7 +44,7 @@ public class TaskPoolConfig { ...@@ -44,7 +44,7 @@ public class TaskPoolConfig {
executor.setMaxPoolSize(2); executor.setMaxPoolSize(2);
// 配置线程池中的线程的名称前缀 // 配置线程池中的线程的名称前缀
executor.setThreadNamePrefix("aiMark-executor-"); executor.setThreadNamePrefix("aiMark-executor-");
executor.setQueueCapacity(100); executor.setQueueCapacity(8);
// rejection-policy:当pool已经达到max size的时候,如何处理新任务 // rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行 // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy()); executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment