Closed anuragvohraec closed 3 years ago
I would do something something like the following?
ThreadPool pool(std::max(1, std::thread::hardware_concurrency() - 1));
I would do something something like the following?
ThreadPool pool(std::max(1, std::thread::hardware_concurrency() - 1));
Why -1 from concurrent thread supported, any specific reason ?
To leave a thread or more (-2, -3) for other stuff that might be required to run. Of course you don't need to be that nice. If you don't the OS will still make sure other things run of course but that might not be ideal.
Hi,
Can any one suggest me how to select an appropriate pool_size value ?
WIll it be equivalent to number of CPU cores on the system ? Or can be greater than it too ?
How do you select it? Specifically if code is supposed to run on different systems?