Skip to content

Commit 13f0e14

Browse files
mkopcinsMateusz Kopciński
andcommitted
bug: fix to a bug where sometimes threadpool could be configured to 0 workers (#671)
## Description In some cases global thread pool was configured to a single thread ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [x] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [x] iOS - [x] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. --> Co-authored-by: Mateusz Kopciński <[email protected]>
1 parent 596af23 commit 13f0e14

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/react-native-executorch/common/rnexecutorch/threads/GlobalThreadPool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class GlobalThreadPool {
3333
::executorch::extension::cpuinfo::get_num_performant_cores();
3434
}
3535

36+
numThreads = std::max(numThreads.value(), 2u);
3637
log(rnexecutorch::LOG_LEVEL::Info, "Initializing global thread pool with",
3738
numThreads, "threads");
3839
instance = std::make_unique<HighPerformanceThreadPool>(numThreads.value(),

0 commit comments

Comments
 (0)