1
1
# Main Thread Scheduling: Prioritized postTask API
2
2
3
- For an overview of the larger problem space, see [ Main Thread Scheduling API] ( README.md ) .
3
+ For an overview of the larger problem space, see [ Main Thread Scheduling API] ( ../ README.md) .
4
4
5
5
## TL;DR
6
6
@@ -11,7 +11,7 @@ experience), but the Platform lacks a unified API to schedule prioritized work.
11
11
## The Problem
12
12
13
13
To keep apps responsive, developers can (and should) break up long tasks into
14
- smaller chunks. [ Userspace schedulers] ( UserspaceSchedulers .md) often manage
14
+ smaller chunks. [ Userspace schedulers] ( ../misc/userspace-schedulers .md) often manage
15
15
these chunks of work (tasks)&mdash ; prioritizing and executing work
16
16
asynchronously at an appropriate time relative to the current situation of the
17
17
user and browser.
@@ -41,7 +41,7 @@ tasks of a given task source.
41
41
42
42
The current state of prioritization in the browser looks something like this:
43
43
44
- ![ Current Web Priorities] ( images/web_priorities_current .png )
44
+ ![ Current Web Priorities] ( ../ images/web-priorities-current .png)
45
45
46
46
The first two&mdash ; * microtask* and * don't yield* &mdash ; are generally
47
47
antithetical to scheduling and the goal of improving responsiveness. They are
@@ -101,7 +101,7 @@ covered by this minimal set of priorities. We also understand that apps may have
101
101
finer-grained app-specific priorities, and are considering additional APIs to
102
102
support these (see FAQ below).
103
103
104
- ![ New Web Scheduling Priorities] ( images/web_priorities_proposed .png )
104
+ ![ New Web Scheduling Priorities] ( ../ images/web-priorities-proposed .png)
105
105
106
106
1 . ** user-blocking** : User-blocking tasks are tasks that block a user from
107
107
interacting with and using the app. This could be (chunked) work that is
@@ -384,7 +384,7 @@ scheduler.postTask(() => { console.log('B'); });
384
384
The API shape described above is the current MVP. The following are
385
385
extensions of the base API that are in various degrees of exploration:
386
386
387
- 1 . [ ** Propagating and Inheriting Priority** ] ( PostTaskPropagation .md) : A
387
+ 1 . [ ** Propagating and Inheriting Priority** ] ( post-task-propagation .md) : A
388
388
frequent request we see from developers is the desire to inherit or
389
389
propagate the currently running task's priority.
390
390
@@ -452,15 +452,15 @@ lightweight solution and will publish an explainer soon.
452
452
Priority inversions occur whenever higher priority work depends on lower
453
453
priority work, so simply by introducing priorities introduces this risk. There
454
454
is only so much the API can do to prevent these situations, although [ inheriting
455
- priority] ( PostTaskPropagation .md) can help to some degree.
455
+ priority] ( post-task-propagation .md) can help to some degree.
456
456
457
457
458
458
This is something that developers should be aware of whenever using
459
459
priorities, and should guard against in situations where a resource is shared
460
460
and can be accessed by multiple, different priority tasks.
461
461
462
462
Some of the situations where this can occur are explored
463
- [ here] ( PriorityInversion .md) , as well as potential solutions. It is not clear
463
+ [ here] ( ../misc/priority-inversion .md) , as well as potential solutions. It is not clear
464
464
at this point that a native solution beyond ` TaskController ` is needed, and we
465
465
await further developer feedback from Origin Trial.
466
466
@@ -503,11 +503,11 @@ concurrent mode).
503
503
The proposal orignally included the ability to pass arguments to the callback,
504
504
like in ` setTimeout ` , but was removed because modern JS supports arrow functions,
505
505
which obviates the need to pass them through ` postTask `
506
- (see [ this issue] ( https://github.com/WICG/main-thread- scheduling/issues/18 ) ).
506
+ (see [ this issue] ( https://github.com/WICG/scheduling-apis /issues/18 ) ).
507
507
508
508
## Security Considerations
509
509
510
- ** Note** : This section summarizes [ this much longer exploration] ( PostTaskSecurity .md) .
510
+ ** Note** : This section summarizes [ this much longer exploration] ( ../misc/post-task-security .md) .
511
511
512
512
The main security concern is whether or not the API adds new surfaces to
513
513
perform side-channel attacks, specifically for same-process cross-origin
0 commit comments