rust/library/std
Matthias Krüger 06110c0c46
Rollup merge of #89670 - yoshuawuyts:available-parallelism-docs, r=joshtriplett
Improve `std:🧵:available_parallelism` docs

_Tracking issue: https://github.com/rust-lang/rust/issues/74479_

This PR reworks the documentation of `std:🧵:available_parallelism`, as requested [here](https://github.com/rust-lang/rust/pull/89324#issuecomment-934343254).

## Changes

The following changes are made:

- We've removed prior mentions of "hardware threads" and instead centers the docs around "parallelism" as a resource available to a program.
- We now provide examples of when `available_parallelism` may return numbers that differ from the number of CPU cores in the host machine.
- We now mention that the amount of available parallelism may change over time.
- We make note of which platform components we don't take into account which more advanced users may want to take note of.
- The example has been updated, which should be a bit easier to use.
- We've added a docs alias to `num-cpus` which provides similar functionality to `available_parallelism`, and is one of the most popular crates on crates.io.

---

Thanks!

r? `@BurntSushi`
2021-10-13 22:51:01 +02:00
..
benches mv std libs to library/ 2020-07-27 19:51:13 -05:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #89670 - yoshuawuyts:available-parallelism-docs, r=joshtriplett 2021-10-13 22:51:01 +02:00
tests Update aarch64 runtime feature detection tests 2021-08-03 12:07:56 +00:00
Cargo.toml Update libc to 0.2.103. 2021-10-06 14:33:13 +00:00
build.rs Add SOLID targets 2021-09-28 11:31:47 +09:00