std: clarify available_parallelism docs for Windows 11 processor groups#159305
Conversation
GetSystemInfo reports only the primary processor group's CPU count. Before Windows 11 and Windows Server 2022 a process was confined to one group by default, so that count matched what it could use; since then processes span all groups by default, so it can undercount the parallelism available.
|
|
|
Is there a more modern API that we can update to than our current usage of anyway, |
|
We can just merge the doc fix as-is but if you figure out a fix for the impl then feel free to tack it on to this PR if you prefer and bors will correctly handle unqueueing it so the fix can be reviewed. |
Thanks, I will take a look at fix for the impl, however need some time to try it and test the ideas for the fix. I could open a separate PR under the same issue when I will have any updates on it. |
Rollup of 15 pull requests Successful merges: - #159311 (Add 1.97.1 release notes) - #156220 (Implement `VecDeque::truncate_to_range`) - #158608 (Implement `#[diagnostic::opaque]` attribute to hide backtraces of macros.) - #159168 (Fix static_mut_refs lint check logic) - #159242 (resolve: Inherit eager invocation parents) - #159256 (Account for async closures when pointing at lifetime in return type) - #159310 (cleanup: upstream dropped AMX-TF32) - #158348 (Add documentation for the `inline` attribute) - #159181 (add rustc_no_writable to mem::forget and structs it uses) - #159191 (Mark `PrivateItems` with `std_internals` unstable feature.) - #159194 (rustdoc: Fix auto trait normalization env) - #159196 (OnceCell: Improve wording in module docs) - #159289 (Fix Zulip backport command suggestion) - #159294 (renovate: don't update PRs in the merge queue) - #159305 (std: clarify available_parallelism docs for Windows 11 processor groups)
Rollup merge of #159305 - valentynkit:docs/available-parallelism-windows, r=workingjubilee std: clarify available_parallelism docs for Windows 11 processor groups On Windows, `available_parallelism`'s docs say the "more than 64 logical CPUs" undercount is harmless because a program needs special support to use more than 64 anyway. That stopped being true in Windows 11 and Windows Server 2022: processes now [span all processor groups by default](https://learn.microsoft.com/en-us/windows/win32/procthread/processor-groups#behavior-starting-with-windows-11-and-windows-server-2022), so a program can use more than 64 without any special handling, while `GetSystemInfo` still counts only one group. Updates the note to describe the before and after. Docs only. Addresses #152389 r? @ChrisDenton
On Windows,
available_parallelism's docs say the "more than 64 logical CPUs" undercount is harmless because a program needs special support to use more than 64 anyway. That stopped being true in Windows 11 and Windows Server 2022: processes now span all processor groups by default, so a program can use more than 64 without any special handling, whileGetSystemInfostill counts only one group.Updates the note to describe the before and after. Docs only.
Addresses #152389
r? @ChrisDenton