Skip to content

Commit ec408c9

Browse files
authored
Rollup merge of rust-lang#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.
2 parents 0a40ade + 39b98e8 commit ec408c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/std/src/thread/mod.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1460,9 +1460,12 @@ fn _assert_sync_and_send() {
14601460
/// The purpose of this API is to provide an easy and portable way to query
14611461
/// the default amount of parallelism the program should use. Among other things it
14621462
/// does not expose information on NUMA regions, does not account for
1463-
/// differences in (co)processor capabilities, and will not modify the program's
1464-
/// global state in order to more accurately query the amount of available
1465-
/// parallelism.
1463+
/// differences in (co)processor capabilities or current system load,
1464+
/// and will not modify the program's global state in order to more accurately
1465+
/// query the amount of available parallelism.
1466+
///
1467+
/// Where both fixed steady-state and burst limits are available the steady-state
1468+
/// capacity will be used to ensure more predictable latencies.
14661469
///
14671470
/// Resource limits can be changed during the runtime of a program, therefore the value is
14681471
/// not cached and instead recomputed every time this function is called. It should not be

0 commit comments

Comments
 (0)