Tools/MMapsGenerator: Use system supported threads instead of hardcoded amount
- Use unsigned int for thread count - Use std::thread::hardware_concurrency() to try estimate available threads instead of hardcoded 3 threads by default - Print thread count always regardless of using --threads switch or not
This commit is contained in:
1 parent
227a4d8ccb
commit
0e6377c90e
3 files changed
+9
-7
No files matched your search
@@ -205,9 +205,11 @@ namespace MMAP
|
||||
}
|
||||
}
|
||||
|
||||
void MapBuilder::buildAllMaps(int threads)
|
||||
void MapBuilder::buildAllMaps(unsigned int threads)
|
||||
{
|
||||
for (int i = 0; i < threads; ++i)
|
||||
printf("Using %u threads to extract mmaps\n", threads);
|
||||
|
||||
for (unsigned int i = 0; i < threads; ++i)
|
||||
{
|
||||
_workerThreads.push_back(std::thread(&MapBuilder::WorkerThread, this));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user