You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
process-daemon: event-driven waiting on Windows #60275
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
On Windows, packages/process-daemon still polls:
The daemon main loop's Listener::wait is a stub that sleeps up to 25 ms (POLL_INTERVAL in src/transport/windows.rs), and Wake::notify is a no-op. That's about 40 wakeups/s when the daemon is idle.
Each live terminal checks whether its root process has exited every 25 ms (EXIT_POLL_INTERVAL in src/service/windows.rs), which adds about 40 wakeups/s per terminal.
Main loop: back Wake with an auto-reset event (CreateEventW, signalled with SetEvent). Listener::wait then calls WaitForMultipleObjects on the wake event plus the pending ConnectNamedPipe overlapped event, using the real timeout. This also lets the shared missed-wake detector run on Windows.
Root-process exit: replace the per-terminal poll with a blocking WaitForSingleObject on the process handle, or use RegisterWaitForSingleObject so a single thread-pool wait handles every terminal.
Thanks for the detailed write-up. I can't measure this here because the sandbox runs Linux and this code path is Windows-only. I did check the source on the latest dev (3829291), and it matches your description:
Listener::wait in packages/process-daemon/src/transport/windows.rs still sleeps up to POLL_INTERVAL (25 ms).
Wake::notify is still an empty function.
wait_and_close in packages/process-daemon/src/service/windows.rs still polls each terminal's root process every EXIT_POLL_INTERVAL (25 ms).
Someone with a Windows machine will need to confirm the wakeup rates and test the event-based approach you proposed.
Activity
opencodejr commentedon Oct 29, 2026
Thanks for the detailed write-up. I can't measure this here because the sandbox runs Linux and this code path is Windows-only. I did check the source on the latest
dev(3829291), and it matches your description:Listener::waitinpackages/process-daemon/src/transport/windows.rsstill sleeps up toPOLL_INTERVAL(25 ms).Wake::notifyis still an empty function.wait_and_closeinpackages/process-daemon/src/service/windows.rsstill polls each terminal's root process everyEXIT_POLL_INTERVAL(25 ms).Someone with a Windows machine will need to confirm the wakeup rates and test the event-based approach you proposed.