time slicing
Splitting a long job into short slices and giving control back to the browser between them so the page stays responsive.
In more detail
It is cooperative: the running code chooses to pause, nothing forces it to. Checking the clock between small units of work decides when to yield.
Example
The React scheduler works for about five milliseconds, then yields to the browser if it has input or drawing to do.Related terms
- concurrent rendering — React ability to prepare several versions of the UI at once and to pause, resume or abandon rendering work so urgent updates are handled first.
- scheduler — A component that decides which piece of pending work runs next and when, based on priorities.
- unit of work — A pattern that collects the changes made during one business operation and commits them together, or not at all.
- main thread — The first thread a program starts with; in a browser page it also runs JavaScript and handles input, layout and painting.
Taught in
- Component Purity: Pure Functions, Idempotence And Side Effects — React 19 & Modern Component Architecture
- React Fiber Architecture: Work Units, Priority And Commits — React 19 & Modern Component Architecture
- Concurrent Mode: Interruptible Work And Lane Priority — React 19 & Modern Component Architecture