context switch
The operating system pausing one thread and resuming another on the same CPU core, which costs time each time it happens.
In more detail
Running far more busy threads than cores causes constant switching, called thrashing, so throughput falls. Matching the number of busy threads to the number of cores avoids it.
Related terms
- thread — A path of execution inside a process that the operating system schedules on a processor; one process can have many.
- CPU core — One independent processing unit inside a CPU; a CPU with eight cores can run eight threads at literally the same time.
Taught in
- Thread Pooling: Piscina & CPU-Bound Workload Pools — Node.js Internals & Backend Services
- It Is Slow, Says Everyone: CPU, Memory, Disk And Network Bottlenecks — CompTIA Linux+ (XK0-006) Exam Prep