Closed Bug 1920115 Opened 10 months ago Closed 3 months ago

Prototype Scheduler.yield

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: sefeng, Assigned: sefeng)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(8 files)

https://wicg.github.io/scheduling-apis/#dom-scheduler-yield

I have a half baked patch, need to finish it.

Depends on: 1928412
Depends on: 1929356
Blocks: 1938246

Spec: https://wicg.github.io/scheduling-apis/#scheduling-state

This patch add the setup for WebTaskSchedulingState so that it
can be set and get in the following patch, by allowing it
to be carried over in continued Promise callbask and be set to
window globals and worker globals.

Blocks: 1941888
Attachment #9459479 - Attachment description: WIP: Bug 1920115 - Refactor TaskSignal to avoid a circular header dependency in the following patches → Bug 1920115 - Refactor TaskSignal to avoid a circular header dependency in the following patches r=#dom-core,jjaschke
Attachment #9459480 - Attachment description: WIP: Bug 1920115 - Add the setup for WebTaskSchedulingState → Bug 1920115 - Add the setup for WebTaskSchedulingState r=#dom-core,jjaschke
Attachment #9459481 - Attachment description: WIP: Bug 1920115 - Implement scheduler.yield → Bug 1920115 - Implement scheduler.yield r=#dom-core,jjaschke
Attachment #9459482 - Attachment description: WIP: Bug 1920115 - Update the ini files for scheduler.yield accordingly → Bug 1920115 - Update the ini files for scheduler.yield accordingly r=#dom-core,jjaschke

This is a missing step in the current implementation. When we about
to select a task, it should pick one from all scheduled tasks, including
the ones scheduled by different schedulers.

Blocks: 1947484
Keywords: dev-doc-needed

In Gecko, unlike other runnables where the TaskController
picks one each at a time, the TimeoutManager allows multiple
timers to run sequentially without allowing other runnables
to run in between.

This patch makes the user_blocking and user_visible tasks
dispatched by Scheduler API can run before timers.

Attachment #9465456 - Attachment description: Bug 1920115 - Allow high priority tasks to run before timers → WIP: Bug 1920115 - Allow high priority tasks to run before timers
Attachment #9465456 - Attachment description: WIP: Bug 1920115 - Allow high priority tasks to run before timers → Bug 1920115 - Allow high priority tasks to run before timers
Attachment #9467432 - Attachment description: Bug 1920115 - Allow higher priority web scheduler scheduled tasks to run before timers → Bug 1920115 - Allow higher priority web scheduler scheduled tasks to run before timers for workers

Instead of passing a single AbortSignal argument to CreateTask,
we now separate it into a AbortSignal and a TaskSignal. They
could be the same when TaskController is used, and if its
AbortController, only AbortSignal is non-null.

Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6b23965ce57e Refactor TaskSignal to avoid a circular header dependency in the following patches r=jjaschke,dom-core https://hg.mozilla.org/integration/autoland/rev/121bf804d2a6 Add the setup for WebTaskSchedulingState r=jjaschke,dom-core,arai https://hg.mozilla.org/integration/autoland/rev/be6c223e63f0 Implement scheduler.yield r=jjaschke,dom-core,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/6c1140811a6c Update the ini files for scheduler.yield accordingly r=jjaschke,dom-core https://hg.mozilla.org/integration/autoland/rev/7522970c5a1d Allow selecting tasks from all existing web schedulers for main thread r=jjaschke,smaug https://hg.mozilla.org/integration/autoland/rev/4ccb6970887e Allow high priority tasks to run before timers r=smaug https://hg.mozilla.org/integration/autoland/rev/6a8cb3cc704e Allow higher priority web scheduler scheduled tasks to run before timers for workers r=smaug https://hg.mozilla.org/integration/autoland/rev/f5357c6c5580 Fix a bug where AbortController doesn't abort scheduler.yield r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50908 for changes under testing/web-platform/tests

Backed out for causing hazard bustages @CycleCollectedJSContext.cpp.

Flags: needinfo?(sefeng)
Upstream PR was closed without merging
Flags: needinfo?(sefeng)
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/912cf1adac80 Refactor TaskSignal to avoid a circular header dependency in the following patches r=jjaschke,dom-core https://hg.mozilla.org/integration/autoland/rev/78181c32bdc6 Add the setup for WebTaskSchedulingState r=jjaschke,dom-core,arai https://hg.mozilla.org/integration/autoland/rev/79b3b0148eb4 Implement scheduler.yield r=jjaschke,dom-core,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/4b579a1c9b46 Update the ini files for scheduler.yield accordingly r=jjaschke,dom-core https://hg.mozilla.org/integration/autoland/rev/0773f669c498 Allow selecting tasks from all existing web schedulers for main thread r=jjaschke,smaug https://hg.mozilla.org/integration/autoland/rev/4739af17e757 Allow high priority tasks to run before timers r=smaug https://hg.mozilla.org/integration/autoland/rev/67bf260fe59b Allow higher priority web scheduler scheduled tasks to run before timers for workers r=smaug https://hg.mozilla.org/integration/autoland/rev/2d0905a92f2c Fix a bug where AbortController doesn't abort scheduler.yield r=smaug
Backout by sstanca@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/991d6e612ec2 Backed out 8 changesets for causing multiple failures.

Backed out for causing multiple failures.

Also, please check these wpt failures. It only fails on Windows 11 x64 24H2 opt and also fails in other forms, as it can be seen here.

Status: RESOLVED → REOPENED
Flags: needinfo?(sefeng)
Resolution: FIXED → ---
Target Milestone: 137 Branch → ---
Upstream PR was closed without merging
Flags: needinfo?(sefeng)
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cfae5efaae37 Refactor TaskSignal to avoid a circular header dependency in the following patches r=jjaschke,dom-core https://hg.mozilla.org/integration/autoland/rev/f441cb5e7e6e Add the setup for WebTaskSchedulingState r=jjaschke,dom-core,arai https://hg.mozilla.org/integration/autoland/rev/bffd879a7547 Implement scheduler.yield r=jjaschke,dom-core,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/2b4f7ebdb0b7 Update the ini files for scheduler.yield accordingly r=jjaschke,dom-core https://hg.mozilla.org/integration/autoland/rev/41d90165c19a Allow selecting tasks from all existing web schedulers for main thread r=jjaschke,smaug https://hg.mozilla.org/integration/autoland/rev/134228f242de Allow high priority tasks to run before timers r=smaug https://hg.mozilla.org/integration/autoland/rev/6934fa78ea13 Allow higher priority web scheduler scheduled tasks to run before timers for workers r=smaug https://hg.mozilla.org/integration/autoland/rev/00dc9f4af854 Fix a bug where AbortController doesn't abort scheduler.yield r=smaug
Regressions: 1957608
Upstream PR merged by moz-wptsync-bot
Regressions: 1957604
Regressions: 1957827
Depends on: 1958173
Blocks: 1958943
Regressions: 1960501
QA Whiteboard: [qa-triage-done-c140/b139]

FF139 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/39310. Mostly a browser compatibility data update and release note/experimental features doc update.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: