fix: auto adjust thread num

This commit is contained in:
tqcq 2024-10-26 10:07:13 +00:00
parent 81f156be08
commit 6374c128af

View File

@ -329,7 +329,7 @@ find_row_mask(std::vector<set_t> &sets,
std::vector<std::thread> workers;
int thread_num = cpu == 0 ? std::thread::hardware_concurrency() : cpu;
if (thread_num > 4) { thread_num = 4; }
if (cpu == 0 && thread_num > 4) { thread_num -= 4; }
fprintf(stderr, "thread_num: %d\n", thread_num);
uint64_t step = 1000;