[WIP] Wake the startup event loop with queued work instead of display.wake() - #4297
Draft
vogella wants to merge 1 commit into
Draft
[WIP] Wake the startup event loop with queued work instead of display.wake()#4297vogella wants to merge 1 commit into
vogella wants to merge 1 commit into
Conversation
WorkbenchAdvisor.openWindows() restores the workbench state on a separate thread while the UI thread spins the event loop. A wake() sent before the UI thread reaches Display.sleep() is dropped, which bug 429363 papered over with a 5 ms sleep in the init thread. Queue an empty StartupRunnable instead: Display.sleep() returns immediately when the synchronizer has pending messages, so the wakeup cannot be lost. Assisted-by: multiple AI agents and layers of automated tooling 🤖
vogella
force-pushed
the
workbench-advisor-wake-race
branch
from
August 30, 2026 12:14
0a41584 to
bdbf651
Compare
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WorkbenchAdvisor.openWindows()restores the workbench state on a separate thread while the UI thread spins the event loop. Adisplay.wake()sent before the UI thread reachesDisplay.sleep()is dropped, which bug 429363 papered over with a 5 ms sleep in the init thread. Queuing an emptyStartupRunnablecloses that race instead of narrowing it, becauseDisplay.sleep()returns immediately when the synchronizer has pending messages, on gtk, win32 and cocoa alike. It has to be aStartupRunnable, sinceUISynchronizerdefers plain runnables until the workbench is up.This path runs on every IDE start,
IDEWorkbenchAdvisordoes not overrideopenWindows(), so it also saves the 5 ms. Draft because the lost wakeup is timing dependent and no test reproduces it, so the reasoning is what needs a second pair of eyes.