Skip to content

std: clarify available_parallelism docs for Windows 11 processor groups#159305

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
valentynkit:docs/available-parallelism-windows
Jul 15, 2026
Merged

std: clarify available_parallelism docs for Windows 11 processor groups#159305
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
valentynkit:docs/available-parallelism-windows

Conversation

@valentynkit

Copy link
Copy Markdown
Contributor

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, while GetSystemInfo still counts only one group.

Updates the note to describe the before and after. Docs only.

Addresses #152389

r? @ChrisDenton

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.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 14, 2026
@rustbot

rustbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

ChrisDenton is not on the review rotation at the moment.
They may take a while to respond.

@workingjubilee

workingjubilee commented Jul 14, 2026

Copy link
Copy Markdown
Member

Is there a more modern API that we can update to than our current usage of GetSystemInfo which would allow fixing this? It would have to still be available on Windows 10 or it might require... effort, to get it to not be called on Windows 10.

anyway,
@bors r+ rollup

@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 5411bb0 has been approved by workingjubilee

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2026
@workingjubilee

Copy link
Copy Markdown
Member

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.

@valentynkit

Copy link
Copy Markdown
Contributor Author

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.

rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
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)
@rust-bors rust-bors Bot merged commit b016514 into rust-lang:main Jul 15, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 15, 2026
rust-timer added a commit that referenced this pull request Jul 15, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants