rust/library
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
..
alloc Rollup merge of #89814 - jkugelman:must-use-string-transforms-typo, r=joshtriplett 2021-10-13 21:55:14 +09:00
backtrace@cc89bb66f9 Update the backtrace crate 2021-09-15 20:32:35 +02:00
core Rollup merge of #89817 - m-ou-se:int-log-10-inline, r=the8472 2021-10-13 21:55:16 +09:00
panic_abort Add SOLID targets 2021-09-28 11:31:47 +09:00
panic_unwind Add SOLID targets 2021-09-28 11:31:47 +09:00
proc_macro Stabilize proc_macro::is_available 2021-10-10 14:09:54 +02:00
profiler_builtins rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rtstartup
rustc-std-workspace-alloc rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-core rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-std rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
std Rollup merge of #89670 - yoshuawuyts:available-parallelism-docs, r=joshtriplett 2021-10-13 22:51:01 +02:00
stdarch@5fdbc476af Update stdarch submodule 2021-09-21 11:24:08 +02:00
test Rollup merge of #89082 - smoelius:master, r=kennytm 2021-10-07 20:26:12 -07:00
unwind Add new target armv7-unknown-linux-uclibceabihf 2021-10-06 14:33:13 +00:00