Study · Course Companion

Exam Prep — Midterm

High confidenceansweredited by Cairni · 방금 · AIv1

Overview

This page summarises everything to review before the midterm and provides practice questions drawn from the lecture notes. See Course Overview for the full topic index. OS Course Notes — Weeks 3 & 5.md

Exam Details

DetailValue
DateWednesday, 22 April 2026
Time14:00
ScopeWeeks 3–5 — Processes, Threads, IPC, CPU Scheduling

OS Course Notes — Weeks 3 & 5.md


Review Checklist

Processes

  • Define a process and explain how it differs from a program (active vs. passive entity). → Processes
  • List and describe all five process states: new → ready → running → waiting → terminated.
  • Explain what a PCB (Process Control Block) stores (state, PC, registers, memory info, open files).
  • Describe the context switch: what is saved/restored, and why it is pure overhead.

Threads

  • Define a thread as a unit of execution within a process. → Threads
  • State what threads share (code, data, heap) vs. what is private (stack, registers).
  • List the four benefits of multithreading: responsiveness, resource sharing, economy, multicore utilisation.
  • Identify the key downside: race conditions when sharing resources.

CPU Scheduling

  • State the scheduling goals: maximise CPU utilisation & throughput; minimise waiting, response, and turnaround time. → CPU Scheduling
  • Know each algorithm's behaviour, strengths, and weaknesses:
AlgorithmKey IdeaStrengthWeakness
FCFSArrival orderSimpleConvoy effect
SJFShortest burst firstOptimal avg. waitHard to predict; starvation
Round RobinTime quantum, cyclicGood responsivenessHigh context-switch overhead if quantum too small
PriorityHighest priority firstFlexibleStarvation (mitigated by aging)
  • Distinguish preemptive (CPU can be reclaimed mid-burst) from non-preemptive (process holds CPU until it yields).
  • Practice average waiting time calculations using hand-drawn Gantt charts for each algorithm.

Practice Questions

  1. 1.Process vs. Program — A .exe file sitting on disk vs. that same file loaded and running: which is a process, and what additional data structures does the OS create for it? OS Course Notes — Weeks 3 & 5.md
  1. 2.State Transitions — Draw the five-state process diagram. What event causes a transition from *running* → *waiting*? What brings a process back to *ready*? OS Course Notes — Weeks 3 & 5.md
  1. 3.Context Switch Cost — Why is a context switch described as "pure overhead"? Under what scheduling conditions does excessive switching hurt throughput? OS Course Notes — Weeks 3 & 5.md
  1. 4.Threads Sharing — Two threads in the same process both increment a shared counter. Why can this produce incorrect results, and what is the term for this problem? OS Course Notes — Weeks 3 & 5.md
  1. 5.Gantt Chart Calculation — Given three processes arriving at time 0 with CPU bursts of 8, 2, and 4 ms, calculate the average waiting time under (a) FCFS, (b) SJF, and (c) Round Robin with quantum = 3 ms. OS Course Notes — Weeks 3 & 5.md
  1. 6.Starvation & Aging — Which two scheduling algorithms risk starvation? How does *aging* solve the problem in Priority Scheduling? OS Course Notes — Weeks 3 & 5.md
  1. 7.Preemptive vs. Non-preemptive — Give one example of each type from the algorithms covered. In a preemptive system, what triggers the CPU to be reclaimed? OS Course Notes — Weeks 3 & 5.md

Key Term Quick-Reference

See the full Key Concepts Glossary for one-line definitions of every core term.

TermOne-liner
PCBOS data structure tracking all state for one process
Context switchSave current PCB, restore next PCB — pure overhead
Race conditionBug where outcome depends on thread execution order
Convoy effectLong FCFS job at front forces all shorter jobs to wait
AgingGradually increasing a waiting process's priority to prevent starvation
Time quantumFixed CPU slice per process in Round Robin

OS Course Notes — Weeks 3 & 5.md


Exam Timeline

AI · 출처 클릭
  1. 2026-04-22
    Midterm — Weeks 3–5 (Processes, Threads, IPC, Scheduling) at 14:00
    OS Course Notes — Weeks 3 & 5.md
Made with CairniExplore public wikis →