Advanced Topic 51 of 51 Operating Systems
Scheduling in Multiprocessors
Balancing load and affinity across CPU cores.
How it works
Multiprocessor scheduling assigns threads to several CPUs. Designs use one global run queue, simple but contended, or per-CPU run queues with load balancing through migration. Processor affinity keeps a thread on the same core to preserve warm caches, and NUMA-aware scheduling places threads near their memory. Gang scheduling runs related threads together, and symmetric multiprocessing treats all cores equally while asymmetric designs like big.LITTLE mix core types.
Step-by-step walkthrough
- Each core has its own run queue.
- Tasks stay on one core to reuse its cache, called affinity.
- One core is overloaded and another idle.
- The scheduler migrates tasks to balance load.
- Balance versus cache warmth is the key trade-off.
Where it is used
Servers, desktops, phones and cloud hypervisors rely on multiprocessor schedulers to keep cores busy and efficient while saving power. Pinning threads is used in latency-sensitive and high-performance applications.
Common pitfall
Migrating threads too often loses cache contents, but unbalanced queues leave cores idle. Lock contention on shared structures limits scalability. Ignoring NUMA causes slow remote memory accesses, and hyperthreading siblings share resources. Measure with perf and use affinity, cpusets or cgroup limits deliberately rather than by habit.
Where it fits in the course
Scheduling in Multiprocessors is topic 51 of 51 in Operating Systems, rated Advanced. It follows Linux Kernel Internals. It is the last topic in this area.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Operating Systems quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Scheduling in Multiprocessors?
Where do people use Scheduling in Multiprocessors?
What is the most common mistake with Scheduling in Multiprocessors?
What should I learn before this topic?
How can I practice it?
Is Scheduling in Multiprocessors hard to learn?
How long does it take to learn Scheduling in Multiprocessors?
Which topics are related to Scheduling in Multiprocessors?
What should I study after Scheduling in Multiprocessors?
Related topics
- Linux Kernel Internals (Operating Systems)
- Microkernels vs Monolithic Kernels (Operating Systems)
- Namespaces and Cgroups (Operating Systems)
- Hypervisors (Operating Systems)
- Real-Time Constraints and Scheduling (Mobile, Embedded & IoT)