Stage 4: cross-platform windows_threading::submit (Win32 fast path + std::thread::spawn fallback) - #4345
Merged
Kenny Kerr (kennykerr) merged 6 commits intoApr 30, 2026
Conversation
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/58d26738-b563-43fb-a499-09081c2f247b Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
…Linux" This reverts commit 59483ec. Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/ad1b0a1e-f08d-4354-b444-d745b9d211f4 Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/331f0b09-e89f-4b3c-bede-e6e23afa6f0c Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/331f0b09-e89f-4b3c-bede-e6e23afa6f0c Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Kenny Kerr (kennykerr)
April 30, 2026 16:55
View session
Kenny Kerr (kennykerr)
marked this pull request as ready for review
April 30, 2026 16:57
Kenny Kerr (kennykerr)
deleted the
copilot/update-cross-todo-documentation
branch
April 30, 2026 17:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues
docs/cross-todo.mdStage 4. The threading_bench example added previously was run on Windows:singleburststeadyPer-submit cost on the Win32 pool drops from 15.67 µs (cold) to 0.46 µs (warm) — clear worker-thread reuse — while
std::thread::spawnstays flat at ~42 µs paying a fullCreateThreadper call. Well past the "≥ 5–10× in steady" threshold from the original decision rule, so: keep thewindows-threadingdependency inwindows-futureand makesubmititself cross-platform.Changes
crates/libs/threading/Cargo.toml— new default-onstdfeature.crates/libs/threading/src/lib.rs— drop the crate-wide#![cfg(windows)].submitgains three cfg-gated bodies:TrySubmitThreadpoolCallback.std(default):std::thread::spawn(f), fire-and-forget.no_std:unimplemented!()— links but signals at runtime that no portable thread primitive is configured.The Win32 surface (
Pool/for_each/thread_id/sleep, thebindingsmodule,check/try_submithelpers) stays Windows-only via#[cfg(windows)]. The crate-levelexpect(non_snake_case, ...)lint group is also gated to Windows since those idents only exist there..github/workflows/linux.yml—windows-threadingandwindows-futureadded to the build and doc loops;windows-threadingalso added to the--no-default-featuresbuild loop so theno_std-without-stdpath stays green.docs/cross-todo.md— Stage 4 rewritten with the measured numbers, the decision, and the implementation. Marked ✅ done.Runtime async tests under
crates/tests/libs/future/are intentionally untouched — they go throughRoInitialize/COM and stay Windows-only; only the build/doc paths ofwindows-futureare exercised on Linux. This unblocks Stage 5 (windows-collectionson Linux).