Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTask-queue should only apply "runnable" concept to tasks #24780
Comments
|
Actually, that's not true. The runnable check is only applied to tasks, because it's only applied to messages that have a pipeline_id: servo/components/script/task_queue.rs Line 140 in d553158 If you look at the various implementations of servo/components/script/script_thread.rs Line 306 in 901fef5 |
|
If anything, this requires a comment, since it fooled the author of the actual code for a while, that makes clear that the servo/components/script/task_queue.rs Line 140 in d553158 |
When a pipeline is not "fully-active", the task-queue stores messages until the pipeline because "fully-active" again. The filtering is done at
servo/components/script/task_queue.rs
Line 142 in d553158
This is meant to implement the concept of runnable, which is how an event-loop selects tasks to run.
So, this concept only applies to tasks, yet the task-queue currently applies it to a
Tmessages, which in practice is a message ultimately containing ascript_runtime::CommonScriptMsg, and not all of these are tasks.So we should only apply the "runnable" test to tasks, not all
T, and the way to find out whetherTcontains a task, is by applying the same check the task-queue already applies in it's related "throttling" logic, by callingT::task_source_nameservo/components/script/task_queue.rs
Line 123 in d553158
If
Tdoesn't have a task-source name, it's not a task, and it should always run whether it's associated document is fully-active or not.