task queue
A list of jobs waiting to be run, taken off in order by whatever runs them, such as an event loop phase or a pool of worker threads.
In more detail
A queue lets a system accept work faster than it can process it for a while. If the queue grows without limit it becomes a memory problem, so real systems cap its length or reject new work.
Related terms
- FIFO — First in, first out: the ordering rule of a queue, where the oldest item is always the next to leave.
- thread pool — A fixed or bounded set of reusable worker threads that take tasks from a queue, instead of creating a new thread for each task.
- backpressure — A slow consumer signalling a fast producer to pause, so data does not pile up in memory faster than it can be handled.
Taught in
- libuv Architecture: Event Demultiplexer & Thread Pool — Node.js Internals & Backend Services
- Event Loop Lifecycle: The Six Phases & libuv uv_run — Node.js Internals & Backend Services
- Thread Pooling: Piscina & CPU-Bound Workload Pools — Node.js Internals & Backend Services