AlgoMaster Logo

Multiprocessor Scheduling

Medium Priority32 min readUpdated August 14, 2026

With multiple CPUs, scheduling involves another decision: not only which thread runs next, but also where it should run.

Suppose a server has eight logical CPUs and twelve runnable threads. Poor placement might leave one CPU idle while another has several threads waiting. Moving a thread to the idle CPU can improve throughput, but it may also discard useful cache data or place the thread farther from the memory it uses.

Multiprocessor scheduling coordinates runnable work across several CPUs while balancing three goals:

  • Keep CPUs busy.
  • Give tasks fair access according to the scheduling policy.
  • Preserve locality by avoiding unnecessary migrations.

The challenge is that load balancing and locality often pull in opposite directions.

This chapter compares global and per-CPU run queues, explains load balancing, affinity, migration costs, and topology-aware placement, and shows how to inspect CPU topology and task placement on Linux.

Premium Content

Subscribe to unlock full access to this content and more premium articles.