From 7297216f20e81935dec4e612f90f3a5f0e9ebea9 Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Sat, 8 Aug 2026 05:59:00 +0000 Subject: 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) --- src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') 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: // ------------------------------------------------------------------ int nWorkers = nHashThreads > 0 ? nHashThreads : (int)std::thread::hardware_concurrency(); - if (nWorkers < 2) nWorkers = 2; - if (nHashThreads <= 0) nWorkers -= 1; // leave one core for node + I/O threads + if (nHashThreads <= 0) { + if (nWorkers < 2) nWorkers = 2; + nWorkers -= 1; // leave one core for node + I/O threads + } + // explicit /hashthreads=N is honored exactly (including 1) ParticipantJobShared jobShared; std::vector shareHits; std::mutex shareHitsMtx; -- cgit v1.2.3