Skip to content

Commit 41199f3

Browse files
committed
available_parallelism: Add documentation for why we don't look at ulimit
1 parent f63685d commit 41199f3

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
@@ -2012,6 +2012,9 @@ fn _assert_sync_and_send() {
20122012
/// which may take time on systems with large numbers of mountpoints.
20132013
/// (This does not apply to cgroup v2, or to processes not in a
20142014
/// cgroup.)
2015+
/// - It does not attempt to take `ulimit` into account. If there is a limit set on the number of
2016+
/// threads, `available_parallelism` cannot know how much of that limit a Rust program should
2017+
/// take, or know in a reliable and race-free way how much of that limit is already taken.
20152018
///
20162019
/// On all targets:
20172020
/// - It may overcount the amount of parallelism available when running in a VM

0 commit comments

Comments
 (0)