Skip to content

Windows support is problematic #1

Open

Description

@lu-zero

See sharkdp/hyperfine#368 for more details.

Using the same approach as chronos requires to:

Add a spawn4() that passes CREATE_SUSPENDED to CreateProcess, creates a JobObject and adds the process to it and then unsuspends it.

To be figured out if there is an easy way to derive the main thread from the process handle.

Activity

  1. added
    bug
    on Sep 2, 2021
  2. lu-zero commented on Aug 22, 2026

    @lu-zero
    OwnerAuthor

    The root fix here (spawn CREATE_SUSPENDED, assign to a Job Object, resume via the main thread handle) is blocked upstream: std::process::Child only exposes the main thread handle needed for ResumeThread behind a nightly-only feature, windows_process_extensions_main_thread_handle (rust-lang/rust#96723), open since 2022. Someone hit this exact use case there as recently as 2026-06-28.

    Building around that gap would mean abandoning std::process::Command/Child on Windows entirely and hand-rolling CreateProcessW, which is a much bigger maintenance surface than this crate should take on for one platform's rusage accuracy. Leaving this open, tracking rust-lang/rust#96723 — worth revisiting once that stabilizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions