full source

This commit is contained in:
luis
2026-01-20 21:37:09 -03:00
parent dbe6ddf847
commit 62ea7784c4
1596 changed files with 795804 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <iostream>
#include <thread>
#include <algorithm>
int main()
{
unsigned int cores = std::thread::hardware_concurrency();
std::cout << "std::thread::hardware_concurrency() = " << cores << std::endl;
// Old formula
unsigned int oldThreads = cores > 2 ? cores - 2 : 1;
std::cout << "Old formula result: " << oldThreads << std::endl;
// New formula (my fix)
unsigned int newThreads = std::max(4u, cores > 6 ? cores - 2 : 4);
std::cout << "New formula result: " << newThreads << std::endl;
return 0;
}