IB Computer Science Operating Systems, Scheduling and Control Systems: Tutor Prep Guide (four schedulers, polling, deadlock, thermostats)
- 2026-11-27
Students can recite that an operating system manages resources and still cannot say which scheduler is faster for four given processes. This lesson ties every function to something measurable: milliseconds, percentages, duty cycle. Students then answer with a number instead of an adjective.
01 Prerequisites (3-minute check)
If any of these fails, fix it before the lesson starts.
| Skill | Quick check | Pass mark |
|---|---|---|
| Programme and process | Two windows of one program open: how many processes | Two; the program is a file, the process is a running instance |
| Division and percentage | What percentage of 26 ms is 1.4 ms | Divides the parts then multiplies by a hundred |
| Sensors and actuators | Which is input and which is output on an air conditioner | Temperature sensing is input, the compressor is output |
02 Lesson flow (60 minutes)
| Time | Stage | Tutor does | Student does |
|---|---|---|---|
| 0-8 min | Opening probe | Ask why ten browser tabs still feel smooth on a four-core CPU | Write answers, compare at the end |
| 8-20 min | OS role and nine functions | One concrete action per function, no list recital | Match functions to situations |
| 20-36 min | Four schedulers | Processes of 8, 4, 9, 5 ms: three methods, one average wait each | Draw Gantt charts and compute waits |
| 36-46 min | Polling and interrupts | 60,000 polls cost 5.0 per cent, interrupts only 0.0004 | Cost both and choose |
| 46-56 min | Deadlock and control systems (HL) | Four deadlock conditions; thermostat duty 20.0 per cent | Name the condition to break |
| 56-60 min | Exit check | Collect three questions, mark at once | Independent work |
03 Teaching script (read it out)
Scene 1: The OS role, which is not managing resources but selling two illusions
Do not recite the nine functions; bind each to an action. Memory management decides who gets which physical pages. Scheduling decides who holds the CPU for the next quantum. Device management wakes the right process when the printer finishes. The file system maps one name to a set of blocks. Security decides which account may read a file. Accounting records how many CPU seconds each user consumed. The GUI routes windows and input to programs. Virtualisation runs several machines on one. Networking maps one socket to one process.
Add the point that gets examined: maintaining system integrity is not antivirus, it is making sure one process cannot kill another by corrupting memory, which needs boundary and privilege enforcement.
Student task: for three situations (two programs opening one file, a printer queue, a user over quota) name which function handles each.
Scene 2: Four schedulers, where every mark sits on the Gantt chart
First come first served runs in arrival order: completion at 8, 12, 21 and 26, so waiting sums to 41 ms and averages 10.25 ms. The trouble is the convoy effect: a short job queued behind a long one waits for all of it.
Round robin with a quantum of 4 ms cycles each process to the back of the queue: completion moves to 20, 8, 26 and 25, average waiting rises to 13.25 ms, but the average response, the first moment each process gets the CPU, is only 6.0 ms. Fairness here means response, not waiting, and students must say it that way, because the question asks why average waiting got worse.
Priority order runs the low number first, giving average waiting 7.5 ms, the best of the three, at the cost of starving low priority work. Multilevel queues split processes into classes with a different method per class, typically round robin in front and first come first served behind.
Finally cost the context switch: at 0.2 ms per switch and a 4 ms quantum, 4.76 per cent of each slice is lost, while a 10 ms quantum drops that to 1.96 per cent. A smaller quantum answers faster and costs more; a larger one saves overhead and feels sluggish.
Student task: rerun round robin at a quantum of 2 ms, count the switches against 7, and say what happens to the overhead percentage.
Scene 3: Polling and interrupts, two ways of paying for the same question
Cost polling: over a 60 second session at one poll every 1 ms there are 60,000 polls, each costing 50 microseconds, so 3.0 seconds of CPU, or 5.0 per cent of one core. In those 60 seconds only 30 keystrokes actually arrived, a hit rate of 0.05 per cent, so 99.95 per cent of the work was wasted. Polling every 20 ms drops the overhead to 0.25 per cent but adds up to 20 ms of latency.
Cost interrupts: 30 events at 8 microseconds each is 240 microseconds, 0.0004 per cent, four orders of magnitude apart.
So the decision is not that interrupts always win. Six criteria decide it: event frequency, CPU overhead, power source, event predictability, controllable latency and security. Keyboards and networks are clearly interrupt driven, but an embedded system reading a sensor every millisecond may poll for simplicity, because a real-time system is judged on worst-case latency, not average latency.
Student task: for three cases (a battery doorbell, a real-time traffic controller, a network card at a hundred thousand packets a second) choose one mechanism and name the two deciding criteria.
04 Question types and worked steps
| Type | Example | Steps | Answer |
|---|---|---|---|
| Compute waiting and response times | Four processes of 8, 4, 9 and 5 ms under three schedulers | Gantt chart first, then completion minus burst gives the wait | 10.25, 13.25 and 7.5 ms |
| Compute polling and interrupt overhead | One poll every 1 ms at 50 microseconds over 60 seconds | Count times cost, then divide by total time | 60,000 polls, 3.0 seconds, 5.0 per cent |
| Diagnose deadlock (HL) | Two processes each hold one resource and wait for the other | Test the four necessary conditions one by one | Mutual exclusion, hold and wait, no preemption, circular wait |
| Design a control loop and its duty cycle (HL) | Target 20.0 degrees, a band of plus or minus 0.5, warming 2.0 degrees an hour, cooling 0.5 | Time to warm and to cool across the same band, then the warm share of the cycle | 75.0 minute cycle at 20.0 per cent |
05 Independent practice (3 questions)
| Question | Answer | What to watch |
|---|---|---|
| Four processes of 8, 4, 9 and 5 ms under first come first served: what is the average waiting time? | 10.25 ms (41 divided by four) | Whether completion minus burst was used |
| Polling every 1 ms at 50 microseconds for 60 seconds: what share of the CPU is spent? | 5.0 per cent (60,000 polls times 50 microseconds is 3.0 seconds) | Whether microseconds were converted to seconds first |
| A thermostat holds a band of plus or minus 0.5 degrees, warming at 2.0 and cooling at 0.5 degrees an hour: what is the duty cycle? | 20.0 per cent (15.0 minutes warming against 60.0 cooling) | Whether the same band width was used on both sides |
06 Common mistakes and what to say
| Mistake | Student writes | Say this |
|---|---|---|
| Treating round robin as always faster | Answering that round robin always lowers average waiting | “Round robin buys response time. At 13.25 ms its average wait is worse than first come first served at 10.25 ms; fairness and speed are different claims.” |
| Reducing integrity to antivirus | Writing that maintaining system integrity means scanning for viruses | “Integrity means processes cannot damage each other: memory boundaries, privilege levels, resource quotas. A virus is one threat, not the definition.” |
| Assuming interrupts always beat polling | Answering that every device should use interrupts | “When events are dense and predictable, polling gives steadier latency and simpler code. Real-time systems are judged on worst case, not average.” |
| Describing deadlock as programs stuck | Writing that deadlock is two programs waiting and a restart fixes it | “Name the four conditions: mutual exclusion, hold and wait, no preemption, circular wait. Breaking any one prevents it, for example by requesting all resources at once.” |
07 Homework (paper, section and question numbers)
- IB Computer Science chapter index — All chapters in this subject
- Translation: compilers, interpreters and JIT — The other chapter: five stages, the 5.71 run break-even, bytecode and JIT
- Tutor prep guide index — Matching chapters in other subjects
08 Exit check (last 5 minutes)
| Question | Answer | Decision |
|---|---|---|
| OS role | Abstract the hardware, share the resources | Reciting manages resources means replay act one |
| Schedulers | Gantt chart, completion minus burst | Missing 10.25, 13.25 or 7.5 means replay act two |
| Polling and interrupts | Counts times cost over total time | Confusing hit rate with overhead means replay act three |
09 Tutor FAQ
How far should multilevel queues go?
A1.3.3 only asks for a comparison of four approaches, so classes with a different method per class and a front-of-house priority is enough. Multilevel feedback queues and aging are extensions for students who ask.
Must students draw Gantt charts?
Yes. The IB question asks for comparison and explanation, and the chart is the evidence that makes the comparison checkable; students who only quote formulas fail as soon as the data changes.
Control systems are HL, so what do SL students need?
A1.3.6 and A1.3.7 are HL only, and SL covers A1.3.1 to A1.3.4. A1.3.4 already names embedded and real-time systems, so SL students meet thermostats and traffic lights, just without controllers and transducers.
Find a tutor — freeTutor Registration →
A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.



