One peach feeds many eaters only because most of them are asleep at any given moment, and that is the whole trick behind virtualizing a CPU.
Why this matters
The illusion rests on a property of the workload, not only on the operating systemβs cleverness. If every process wanted the processor continuously there would be nothing to snatch, and no amount of OS machinery would keep the peach whole.Part I opens with the bookβs most famous analogy. Youβve already seen virtualization happen β four programs sharing one CPU in chapter 2 β so consider this the parable version.
The analogy, drawn out
One physical resource, many convincing virtual copies (dashed). The violet arrows are the OSβs doing β and how it pulls this off is the subject of the next seven chapters.
Tip: βNappingβ has a technical name
The Professorβs trick β snatch the peach while its eater naps β is exactly what you watched in chapter 2βs timeline: at any instant one process runs while the others sit in the ready state (or sleep waiting for I/O), none the wiser. Chapter 4 gives the napping its proper names: time sharing and process states.Note what the dialogue deliberately doesnβt answer: the Studentβs βhow does that work?β The mechanism β how the OS actually snatches a CPU away and hands it to someone else without anyone crashing β is the story of the chapters ahead: the process abstraction, its API, limited direct execution, and then the scheduling policies that decide who eats next.
If you remember only three things
-
βPhysicalβ and βvirtualβ are the bookβs two standing adjectives. The single peach that exists is physical, the many handed out are virtual, and the mechanisms of Part I exist to maintain that gap.
-
An illusion only has to survive what can be checked. The Student objects that they would surely notice the sharing, and the answer is that they would not, because they are not looking most of the time.
-
The parable answers βwhatβ and refuses βhowβ. The Student asks how it works and is told to wait; the mechanism takes the next seven chapters, which is the honest length of that answer.
Check yourself
1.In the peach analogy, what does the peach stand for?
2.The Student objects: "if I was sharing a peach, I would notice." What is the Professor's answer?
3.The Student asks "How does that work?" β and gets no answer. Which question does this dialogue deliberately leave open?