Hi,
I was looking for a thread pool, and found this repo. Thanks for working on this.
I was browsing the dependencies and saw that you use num_cpus to decide how many worker threads to use by default:
let num_threads = self.num_threads.unwrap_or_else(num_cpus::get);
Would it not be better to look into the affinity mask to get this default? The system may have 64 cores, but have the process pinned to, e.g. 4 cores. This would cause contention.
I found this crate, which might help (disclaimer, I've not used it and I'm not sure how portable it is):
https://crates.io/crates/core_affinity
Thanks
Hi,
I was looking for a thread pool, and found this repo. Thanks for working on this.
I was browsing the dependencies and saw that you use
num_cpusto decide how many worker threads to use by default:Would it not be better to look into the affinity mask to get this default? The system may have 64 cores, but have the process pinned to, e.g. 4 cores. This would cause contention.
I found this crate, which might help (disclaimer, I've not used it and I'm not sure how portable it is):
https://crates.io/crates/core_affinity
Thanks