ThreadUtils thread count adjusted to limited value to avoid lockups#555
ThreadUtils thread count adjusted to limited value to avoid lockups#555echicoine-icf wants to merge 4 commits intocqframework:masterfrom
Conversation
…n unix based operating systems.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #555 +/- ##
=========================================
Coverage 21.42% 21.43%
Complexity 1703 1703
=========================================
Files 303 303
Lines 26379 26382 +3
Branches 4204 4204
=========================================
+ Hits 5653 5656 +3
Misses 19787 19787
Partials 939 939 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| private static List<ExecutorService> runningExecutors = new ArrayList<>(); | ||
|
|
||
| private static final int threadPoolCount = Runtime.getRuntime().availableProcessors() * 2; |
There was a problem hiding this comment.
Using a magic number heuristic here. It makes sense in context, but I would prefer a safer approach, like the following:
private static final int threadPoolCount = Integer.getInteger("threadutils.pool.count", Runtime.getRuntime().availableProcessors());
This allows configuration to override e.g. -Dthreadutils.pool.count=8
There was a problem hiding this comment.
Using a magic number heuristic here. It makes sense in context, but I would prefer a safer approach, like the following:
private static final int threadPoolCount = Integer.getInteger("threadutils.pool.count", Runtime.getRuntime().availableProcessors());This allows configuration to override e.g.
-Dthreadutils.pool.count=8
I do like this better. Thank you!
…into threadutils-threadcount
Adjusted ThreadUtils after discovering macOS/linux does not handle cached executor as Windows does. Executor set to fixed thread pool (cpu core count * 2)
By creating this PR you acknowledge that your contribution will be licensed under Apache 2.0