Skip to content

Comments

fix: clean up inproc handler sync#1533

Merged
supervacuus merged 5 commits intomasterfrom
fix/limit_inproc_init_wait_granularity
Feb 19, 2026
Merged

fix: clean up inproc handler sync#1533
supervacuus merged 5 commits intomasterfrom
fix/limit_inproc_init_wait_granularity

Conversation

@supervacuus
Copy link
Collaborator

I just saw that, due to the wait for the inproc handler thread in the recent changes, our inproc init benchmark regressed unnecessarily because of the poll loop's rather coarse 10ms granularity.

I took this as an inspiration to clean up the handler sync a bit:

  • This PR doesn't spin on an atomic with a sleep interval each loop iteration but uses OS-level polling (pollfd on a pipe and WaitForSingleObject on an Event respectively) with a timeout. That should dramatically reduce the init wait without any wasteful sleeping on our side.
  • It also extracts a significant part of the signal-handler-to-handler-thread sync into functions, so that the rather noisy sync primitives don't flood the actual behavioral code.

Would be great to pack this in before the breaking 0.13.0.

(since this is a follow-up to the unreleased #1446)
#skip-changelog

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@supervacuus supervacuus force-pushed the fix/limit_inproc_init_wait_granularity branch from 56f32d6 to f70d15d Compare February 19, 2026 12:57
…in CI

also make abort() popups on Windows a global config for the inproc stress test.
Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice cleanup 👍

@supervacuus supervacuus merged commit 2475b26 into master Feb 19, 2026
47 checks passed
@supervacuus supervacuus deleted the fix/limit_inproc_init_wait_granularity branch February 19, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants