diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-08 05:59:00 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 04:37:36 +0000 |
| commit | 7297216f20e81935dec4e612f90f3a5f0e9ebea9 (patch) | |
| tree | 3801e440cdc42146baaee05ea5c906ba278c6a64 /src | |
| parent | 7a8f7e7fa767d19f44f0a6a6db84de68f812bebe (diff) | |
participant: honor explicit /hashthreads=1 (floor of 2 only in auto mode)
The min-2-threads floor applied even when the user explicitly asked
for 1 thread, so /hashthreads=1 silently spawned 2.
(cherry picked from commit a67b9e84f4f7607d307081b4a9873f5d9e78cf8a)
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 69d9d30..f84f209 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
| @@ -3814,8 +3814,11 @@ connected: | |||
| 3814 | // ------------------------------------------------------------------ | 3814 | // ------------------------------------------------------------------ |
| 3815 | int nWorkers = nHashThreads > 0 ? nHashThreads | 3815 | int nWorkers = nHashThreads > 0 ? nHashThreads |
| 3816 | : (int)std::thread::hardware_concurrency(); | 3816 | : (int)std::thread::hardware_concurrency(); |
| 3817 | if (nWorkers < 2) nWorkers = 2; | 3817 | if (nHashThreads <= 0) { |
| 3818 | if (nHashThreads <= 0) nWorkers -= 1; // leave one core for node + I/O threads | 3818 | if (nWorkers < 2) nWorkers = 2; |
| 3819 | nWorkers -= 1; // leave one core for node + I/O threads | ||
| 3820 | } | ||
| 3821 | // explicit /hashthreads=N is honored exactly (including 1) | ||
| 3819 | ParticipantJobShared jobShared; | 3822 | ParticipantJobShared jobShared; |
| 3820 | std::vector<ParticipantShareHit> shareHits; | 3823 | std::vector<ParticipantShareHit> shareHits; |
| 3821 | std::mutex shareHitsMtx; | 3824 | std::mutex shareHitsMtx; |