Skip to main content

One post tagged with "Scheduling"

Thread scheduling mechanisms and algorithms

View All Tags

Thread Execution, Scheduling, and Multiprocessing on XNU

· 42 min read
Pranav Ram Joshi
Software Engineer — Systems & Networks

Man is born free, and everywhere he is in chains. - Jean-Jacques Rousseau; The Social Contract

Preamble​

This post explores how XNU — the kernel behind macOS and iOS — schedules and executes threads across processors. We'll look at preemptive scheduling, the Mach continuation model that allows kernel stacks to be reclaimed, and the hardware topology that underlies multiprocessing: cores, dies, SMT, and the distinction between symmetric and asymmetric multiprocessing.

This post builds on the Mach abstractions covered in Mach Kernel Abstractions and XNU Internals. Familiarity with Mach tasks and threads will be helpful but is not strictly required.