diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-11-27 11:46:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-27 11:46:42 +0100 |
| commit | 8fb58e5eced05e493a0431ee291ad955fb32cacf (patch) | |
| tree | 6016ece3d74e3a2f74e404eb2274f49c69c098f4 /library/std | |
| parent | 43279b27498c05cc11f08501ad6410397e9e4837 (diff) | |
| parent | 39b98e8c1a86a2788c05930779b343dd4c334971 (diff) | |
| download | rust-8fb58e5eced05e493a0431ee291ad955fb32cacf.tar.gz rust-8fb58e5eced05e493a0431ee291ad955fb32cacf.zip | |
Rollup merge of #91057 - the8472:clarify-parallelism-steady-state, r=dtolnay
Expand `available_parallelism` docs in anticipation of cgroup quota support The "fixed" in "fixed steady state limits" means to exclude load-dependent resource prioritization that would calculate to 100% of capacity on an idle system and less capacity on a loaded system. Additionally I also exclude "system load" since it would be silly to try to identify other, perhaps higher priority, processes hogging some CPU cores that aren't explicitly excluded by masks/quotas/whatever.
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/thread/mod.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 39b53b51bfa..343d3ef8dc5 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -1460,9 +1460,12 @@ fn _assert_sync_and_send() { /// The purpose of this API is to provide an easy and portable way to query /// the default amount of parallelism the program should use. Among other things it /// does not expose information on NUMA regions, does not account for -/// differences in (co)processor capabilities, and will not modify the program's -/// global state in order to more accurately query the amount of available -/// parallelism. +/// differences in (co)processor capabilities or current system load, +/// and will not modify the program's global state in order to more accurately +/// query the amount of available parallelism. +/// +/// Where both fixed steady-state and burst limits are available the steady-state +/// capacity will be used to ensure more predictable latencies. /// /// Resource limits can be changed during the runtime of a program, therefore the value is /// not cached and instead recomputed every time this function is called. It should not be |
