work stealing
A scheduling method where each worker has its own queue and an idle worker takes tasks from a busy worker's queue.
In more detail
It keeps every thread busy with little coordination. Busy workers stay busy while idle ones pick up the slack, without a central queue becoming a bottleneck.
Related terms
- 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.
- 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.
Taught in
- Thread Pooling: Piscina & CPU-Bound Workload Pools — Node.js Internals & Backend Services