Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd more documentation #61
Conversation
derekdreery
referenced this pull request
Oct 17, 2017
Open
num_cpus library evaluation tracking issue #55
seanmonstar
reviewed
Oct 17, 2017
| /// thread does not have access to all the computer's cpus. | ||
| /// | ||
| /// [smt]: https://en.wikipedia.org/wiki/Simultaneous_multithreading | ||
| /// [sched affinity]: https://en.wikipedia.org/wiki/Simultaneous_multithreading |
This comment has been minimized.
This comment has been minimized.
| /// | ||
| /// ``` | ||
| /// let logical_cpus = num_cpus::get(); | ||
| /// let physical_cpus = num_cpus::get(); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
GabrielMajeri
suggested changes
Oct 18, 2017
|
There are some minor issues that need to get fixed. |
| //! A crate with utilities to determine the number of CPUs available on the | ||
| //! current system. | ||
| //! | ||
| //! Sometimes the cpu will exaggerate the number of cpus it contains, because it can use |
This comment has been minimized.
This comment has been minimized.
GabrielMajeri
Oct 18, 2017
Contributor
I think it would be a good idea to stick to writing "CPU" or "CPUs" in capital letters, for consistency.
| //! number 8, it could use the number of cpus). | ||
| //! | ||
| //! [processor tricks]: https://en.wikipedia.org/wiki/Simultaneous_multithreading | ||
| //! [`rayon::ThreadPool`]: https://doc.rs/rayon/0.8.2/rayon/struct.ThreadPool.html |
This comment has been minimized.
This comment has been minimized.
GabrielMajeri
Oct 18, 2017
Contributor
Link is broken, should be https://docs.rs/rayon/0.8.2/rayon/struct.ThreadPool.html (instead of doc.rs)
| @@ -18,10 +36,29 @@ extern crate libc; | |||
|
|
|||
|
|
|||
| /// Returns the number of available CPUs of the current system. | |||
| /// | |||
| /// This function will get the number of logical cores. Sometimes this is different to the number | |||
This comment has been minimized.
This comment has been minimized.
GabrielMajeri
Oct 18, 2017
Contributor
Typo: should be different from the....
Maybe we should rewrite it as "This number might be different from the number of..." instead of "Sometimes this is different..."
This comment has been minimized.
This comment has been minimized.
derekdreery
Oct 18, 2017
Author
Contributor
I think they're both valid English, but I'll change to from.
I've looked this up and apparently "different to" is British English mainly, so "different from" is probably more international: https://en.oxforddictionaries.com/usage/different-from-than-or-to
| @@ -18,10 +36,29 @@ extern crate libc; | |||
|
|
|||
|
|
|||
| /// Returns the number of available CPUs of the current system. | |||
| /// | |||
| /// This function will get the number of logical cores. Sometimes this is different to the number | |||
| /// of physical cores becuase the cpu chip can deliver better performance when using more threads. | |||
This comment has been minimized.
This comment has been minimized.
GabrielMajeri
Oct 18, 2017
Contributor
Whether SMT actually delivers more performance or not is debatable.
I think we should just stick to saying that some systems have multiple logical cores per physical CPU core, and link to "Simultaneous multithreading" as an example.
This comment has been minimized.
This comment has been minimized.
| /// | ||
| /// This function will get the number of logical cores. Sometimes this is different to the number | ||
| /// of physical cores becuase the cpu chip can deliver better performance when using more threads. | ||
| /// (See [simultaneous multithreading on wikipedia][smt]). |
This comment has been minimized.
This comment has been minimized.
seanmonstar
merged commit 4193d17
into
seanmonstar:master
Oct 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Thank you! |
derekdreery commentedOct 17, 2017
Hope it is useful. Please read before you accept to make sure you're happy.