Skip to content

iOS: Remove the non-merged thread topology - #190698

Merged
cbracken merged 1 commit into
flutter:masterfrom
cbracken:platform-and-ui-bffs
Aug 7, 2026
Merged

iOS: Remove the non-merged thread topology#190698
cbracken merged 1 commit into
flutter:masterfrom
cbracken:platform-and-ui-bffs

Conversation

@cbracken

@cbracken cbracken commented Aug 7, 2026

Copy link
Copy Markdown
Member

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 #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: #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-assist bot 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.

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
@cbracken
cbracken requested a review from a team as a code owner August 7, 2026 05:11
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 7, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Aug 7, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants