iOS: Remove the non-merged thread topology - #190698
Merged
Merged
Conversation
iOS runs with the platform and UI threads merged, and it's not possible to create an engine with unmerged platform/ui threads, but `FlutterEngine` still included branches to create the unmerged threads when `Settings::merged_platform_ui_thread` wasn't enabled. The option to opt-out of merged threads on iOS was removed in flutter#174408 in Aug 2025, and it had been the default configuration for over a year at that point. Both existing routes to a non-merged thread configuration already failed at startup: * Setting `FLTEnableMergedPlatformUIThread=false` in Info.plist causes an `FML_CHECK` in `FlutterDartProject.mm` to blow up. * Setting `--no-enable-merged-platform-ui-thread` or `--merged-platform-ui-thread=disabled` results in them being parsed into Settings::merged_platform_ui_thread in `SettingsFromCommandLine`, and triggers the same `FML_CHECK`. The only route that didn't trigger an abort() on startup was `-[FlutterDartProject initWithSettings:]`, which is declared in `FlutterDartProject_Internal.h` and isn't part of the framework's public API. This also removes the last place the iOS embedder checked `Settings::enable_impeller`. Now it's simply assumed. This is part of cleanup work intended to simplify the iOS embedder prior to an eventual migration to the embedder API. Issue: flutter#112232
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the option to unmerge the platform and UI threads on iOS, ensuring they are always merged. It removes the _uiTaskRunnerWrapper member variable, simplifies MakeThreadHost by removing the settings parameter and the creation of a dedicated UI thread, and updates createShell: to use the platform thread's task runner for the UI task runner. Additionally, the test testCanUnMergePlatformAndUIThread has been removed. There are no review comments, and I have no feedback to provide.
hellohuanlin
approved these changes
Aug 7, 2026
This was referenced Aug 8, 2026
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.
iOS runs with the platform and UI threads merged, and it's not possible to create an engine with unmerged platform/ui threads, but
FlutterEnginestill included branches to create the unmerged threads whenSettings::merged_platform_ui_threadwasn't enabled.The option to opt-out of merged threads on iOS was removed in #174408 in Aug 2025, and it had been the default configuration for over a year at that point.
Both existing routes to a non-merged thread configuration already failed at startup:
FLTEnableMergedPlatformUIThread=falsein Info.plist causes anFML_CHECKinFlutterDartProject.mmto blow up.--no-enable-merged-platform-ui-threador--merged-platform-ui-thread=disabledresults in them being parsed into Settings::merged_platform_ui_thread inSettingsFromCommandLine, and triggers the sameFML_CHECK.The only route that didn't trigger an abort() on startup was
-[FlutterDartProject initWithSettings:], which is declared inFlutterDartProject_Internal.hand isn't part of the framework's public API.This also removes the last place the iOS embedder checked
Settings::enable_impeller. Now it's simply assumed.This is part of cleanup work intended to simplify the iOS embedder prior to an eventual migration to the embedder API.
Issue: #112232
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.