starvation
When one kind of work keeps getting the processor so other work, such as rendering, never gets a turn.
In more detail
The page looks frozen even though code is running. Microtasks that keep scheduling more microtasks starve rendering, because the queue must be empty before the browser can paint.
Related terms
- microtask — A small job, such as a promise callback, that runs as soon as the current piece of JavaScript finishes, before the event loop handles anything else.
- rendering opportunity — A point in the event loop, between tasks, when the browser may run animation callbacks, recalculate style and layout, and paint a new frame.
Taught in
- The Browser Event Loop: Call Stack, Microtasks And Macrotasks — Frontend Architecture & Web Platform