derniercri / snatch

A simple, fast and interruptable download accelerator, written in Rust
MIT License
676 stars 37 forks source link

Default threads number depends on the local core number #36

Closed Jean-Serge closed 7 years ago

Jean-Serge commented 7 years ago

Resolution proposition for #5

k0pernicus commented 7 years ago

I don't agree with this PR - actually, you get the number of CPUs (physical cores) of the machine, not the number of threads (global / per core) of this one. Based on the documentation of the num_cpus crate, the number of threads to use for Snatch is num_cpus::get() * num_cpus::get_physical().

Jean-Serge commented 7 years ago

Yes and no. Even if we were talking about core numbers instead of CPUs we should consider to launch a thread for each CPUs because that is the way our OS is seeing it.

k0pernicus commented 7 years ago

Sure, otherwise I think we should get the number of physical CPUs by default, instead of logical CPUs, as considering this issue.

Jean-Serge commented 7 years ago

Thanks for the link I didn't understand this.