mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-23 06:50:25 +01:00
Bump MCUtils#asyncExecutor core size
Long ago we discovered that the default thread pools would not increase the number of threads running the pool until queue addition failed. Bumping the core size mitigates an issue with spark-paper, and in general, keeping async threads around generally beats having to spin new ones everytime we want to execute a periodic async task.
This commit is contained in:
parent
5a5035be96
commit
e1462a9253
1 changed files with 2 additions and 2 deletions
|
@ -4077,7 +4077,7 @@ index 0000000000000000000000000000000000000000..197224e31175252d8438a8df585bbb65
|
|||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c9bebadaf4be03cc92774b7367aeecdd380046f1
|
||||
index 0000000000000000000000000000000000000000..0449d4619e3a0752dea0981fb149542e23076c52
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -0,0 +1,176 @@
|
||||
|
@ -4114,7 +4114,7 @@ index 0000000000000000000000000000000000000000..c9bebadaf4be03cc92774b7367aeecdd
|
|||
+ }
|
||||
+ };
|
||||
+ public static final ThreadPoolExecutor asyncExecutor = new ThreadPoolExecutor(
|
||||
+ 0, 2, 60L, TimeUnit.SECONDS,
|
||||
+ 2, 2, 60L, TimeUnit.SECONDS,
|
||||
+ new LinkedBlockingQueue<>(),
|
||||
+ new ThreadFactoryBuilder()
|
||||
+ .setNameFormat("Paper Async Task Handler Thread - %1$d")
|
||||
|
|
Loading…
Reference in a new issue