Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: Improve foreground task dispatching on Windows (continued) #23415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JunkuiZhang
Copy link
Contributor

Closes #22653 again

In PR #23283, I thought that every runnable dispatched to the main thread would correspond to an EVENT_DISPATCHED message in the message queue. However, after testing, some runnables occasionally weren’t executed.

This PR updated the code as follows:

if let Ok(runnable) = self.main_receiver.try_recv() {    <-- before
for runnable in self.main_receiver.drain() {            <-- after
    runnable.run();
}

This ensures that runnables are handled more proactively on the main thread, now we handle runnables with a much higher priority.

A big thanks to @MolotovCherry and @ArthurBrussee for their testing efforts!

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 21, 2025
@maxdeviant maxdeviant changed the title windows: Improve foreground task dispatching on Windows continue windows: Improve foreground task dispatching on Windows (continued) Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[windows] Debug(?) builds do not progress without user actions
1 participant