Skip to content

Commit e65201c

Browse files
authored
Rollup merge of rust-lang#144188 - joshtriplett:available-parallelism, r=Mark-Simulacrum
`available_parallelism`: Add documentation for why we don't look at `ulimit`
2 parents 625b180 + 41199f3 commit e65201c

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)