Skip to content

Wake up more waiters on waitable-sets - #14638

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:wake-more-waiters
Oct 10, 2026
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:wake-more-waiters

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

When an event is delivered to a waitable set technically any thread in that set is candidate for receiving the event, but prior to this commit Wasmtime would only ever deliver the event to one arbitrary thread in the set. This caused issues when that thread cannot run due to the instance's lock being held, meaning that other candidate threads couldn't run to completion and actually get the event. This commit handles this situation by waking up other threads in in this situation. Only one thread will still get the event, and others go back to sleep if it's stolen.

When an event is delivered to a waitable set technically any thread in
that set is candidate for receiving the event, but prior to this commit
Wasmtime would only ever deliver the event to one arbitrary thread in
the set. This caused issues when that thread cannot run due to the
instance's lock being held, meaning that other candidate threads
couldn't run to completion and actually get the event. This commit
handles this situation by waking up other threads in in this situation.
Only one thread will still get the event, and others go back to sleep if
it's stolen.
@alexcrichton
alexcrichton requested a review from dicej October 9, 2026 20:33
@alexcrichton
alexcrichton requested a review from a team as a code owner October 9, 2026 20:33
@alexcrichton
alexcrichton added this pull request to the merge queue Oct 9, 2026
Merged via the queue into bytecodealliance:main with commit b9f359c Oct 10, 2026
53 checks passed
@alexcrichton
alexcrichton deleted the wake-more-waiters branch October 10, 2026 00:23
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