Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@yeatse
Copy link
Contributor

@yeatse yeatse commented Jul 9, 2022

Until we remove the latch in Shell::OnPlatformViewCreated, the priority of IO thread should not be too low, otherwise the app will be stuck more often.

Fixes flutter/flutter#107351 and flutter/flutter#106773

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@yeatse yeatse marked this pull request as ready for review July 9, 2022 19:06
@yeatse yeatse changed the title Increase IO thread's priority on iOS to avoid priority inversions Increase IO thread's priority on iOS to avoid stucks Jul 9, 2022
@JsouLiang
Copy link
Contributor

Could you increase the IO thread's priority in Android?

@yeatse
Copy link
Contributor Author

yeatse commented Jul 11, 2022

Could you increase the IO thread's priority in Android?

@JsouLiang From the linked issues it seems this problem is only affecting iOS devices. On android the status quo is good enough so without a suitable reason I have no idea which priority should I tune it to. Any suggestion?

@dnfield
Copy link
Contributor

dnfield commented Jul 11, 2022

Lets do it for Android in a separate patch.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM

Priority inversion can occur when we have the platform thread waiting on a lower priority thread. We should fix this on Android too. @jason-simmons tells me he has a patch in the works to do that.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 11, 2022
@ssyzh
Copy link

ssyzh commented Aug 3, 2022

hello,Is there a release plan and in which version?

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

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread priority changes make app more easily to be stuck in production

5 participants