Skip to content

Commit 624c99d

Browse files
authored
Unrolled build for #144188
Rollup merge of #144188 - joshtriplett:available-parallelism, r=Mark-Simulacrum `available_parallelism`: Add documentation for why we don't look at `ulimit`
2 parents 383b9c4 + 41199f3 commit 624c99d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/thread/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,9 @@ fn _assert_sync_and_send() {
20182018
/// which may take time on systems with large numbers of mountpoints.
20192019
/// (This does not apply to cgroup v2, or to processes not in a
20202020
/// cgroup.)
2021+
/// - It does not attempt to take `ulimit` into account. If there is a limit set on the number of
2022+
/// threads, `available_parallelism` cannot know how much of that limit a Rust program should
2023+
/// take, or know in a reliable and race-free way how much of that limit is already taken.
20212024
///
20222025
/// On all targets:
20232026
/// - It may overcount the amount of parallelism available when running in a VM

0 commit comments

Comments
 (0)