aboutsummaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-08-04 19:11:40 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-08-04 19:11:40 +0000
commit9d42acaa1bb26e68cb6b0c436a4f69af00a27be5 (patch)
tree1e0e373f4aa7f38f8265d83470885f868506fc34 /container-core
parentea481119e597fc3db83be3dcbda18a66e8ab196a (diff)
Add flags for controlling threads for feeding.
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java
index 6fc9da298a8..edbe12b64c6 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java
@@ -83,7 +83,9 @@ public class ContainerThreadPool implements AutoCloseable {
}
private static int computeCoreThreadPoolSize(int corePoolSize, int maxNumThreads) {
- return Math.min(corePoolSize, maxNumThreads);
+ return Math.min(
+ corePoolSize <= 0 ? Runtime.getRuntime().availableProcessors() * 2 : corePoolSize,
+ maxNumThreads);
}
}