Skip to content

Commit 1680359

Browse files
authored
Rollup merge of #90198 - the8472:available-parallelism-runtime, r=joshtriplett
Add caveat about changing parallelism and function call overhead As discussed in #89670 (comment) r? ``@joshtriplett``
2 parents 74a0c49 + fd25491 commit 1680359

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/std/src/thread/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,10 @@ fn _assert_sync_and_send() {
14491449
/// global state in order to more accurately query the amount of available
14501450
/// parallelism.
14511451
///
1452+
/// Resource limits can be changed during the runtime of a program, therefore the value is
1453+
/// not cached and instead recomputed every time this function is called. It should not be
1454+
/// called from hot code.
1455+
///
14521456
/// The value returned by this function should be considered a simplified
14531457
/// approximation of the actual amount of parallelism available at any given
14541458
/// time. To get a more detailed or precise overview of the amount of

0 commit comments

Comments
 (0)