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

More correctly name methods regarding event loop that are currently named microtask #50138

Merged

Conversation

mkustermann
Copy link
Member

Flutter implements the UI isolates message via posting to a UI task queue. That task queue has a primary and a secondary queue. The

  • primary is used for running tasks resulated to framework (e.g. draw frame)
  • secondary is used to run Dart event loop messages (e.g. received data on a socket)

The Dart semantics requires running microtasks before processing the next event loop message.

The way flutter implements by attaching an observer to the secondary queue. Every time a task from the queue is run, all observers are run and one of them is going to run pending microtasks.

In some situations the engine pauses the dart event loop. The terminology used in the code is "microtask" when in reality what it means is "event loop".

=> This PR changes this terminology to reflect what actually happens.

…amed microtask

Flutter implements the UI isolates message via posting to a UI task
queue. That task queue has a primary and a secondary queue. The

* primary is used for running tasks resulated to framework (e.g. draw frame)
* secondary is used to run Dart event loop messages (e.g. received data on a socket)

The Dart semantics requires running microtasks before processing the
next event loop message.

The way flutter implements by attaching an observer to the secondary
queue. Every time a task from the queue is run, all observers are run
and one of them is going to run pending microtasks.

In some situations the engine pauses the dart event loop. The
terminology used in the code is "microtask" when in reality what it
means is "event loop".

=> This PR changes this terminology to reflect what actually happens.
@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 31, 2024
@auto-submit auto-submit bot merged commit fdf19c4 into flutter:main Jan 31, 2024
28 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 31, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 31, 2024
…142583)

flutter/engine@2d2d880...8e7df85

2024-01-31 [email protected] Roll Skia from bf27636582c7 to 1fbb575f968d (1 revision) (flutter/engine#50190)
2024-01-31 [email protected] More correctly name methods regarding event loop that are currently named microtask (flutter/engine#50138)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
@@ -79,8 79,8 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
Callback callback_;
std::unordered_map<uintptr_t, fml::closure> secondary_callbacks_;

void PauseDartMicroTasks();
static void ResumeDartMicroTasks(fml::TaskQueueId ui_task_queue_id);
void PauseDartEventLoopTasks();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the "Tasks" be removed from the end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
3 participants