Skip to content

Commit fd25491

Browse files
committed
Add caveat about changing parallelism and function call overhead
1 parent cf70855 commit fd25491

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: 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)