Commit 7bd75feb authored by lihao's avatar lihao

修改默认线程池数量

parent 969ac042
......@@ -13,7 +13,9 @@ public class TaskPoolFactory {
}
public static <T, U, R> TaskExecutor<T, U, R> createExecutor() {
return createExecutor(new ThreadPoolExecutor(2, 3, 0L, TimeUnit.MILLISECONDS,
int core = Runtime.getRuntime().availableProcessors();
int poolSize = Math.min(core / 2, 4);
return createExecutor(new ThreadPoolExecutor(poolSize, poolSize + 1, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>()), 15L, TimeUnit.SECONDS);
}
......
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