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
| Detail | Value |
|---|---|
| Date | Wednesday, 22 April 2026 |
| Time | 14:00 |
| Scope | Weeks 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:
| Algorithm | Key Idea | Strength | Weakness |
|---|---|---|---|
| FCFS | Arrival order | Simple | Convoy effect |
| SJF | Shortest burst first | Optimal avg. wait | Hard to predict; starvation |
| Round Robin | Time quantum, cyclic | Good responsiveness | High context-switch overhead if quantum too small |
| Priority | Highest priority first | Flexible | Starvation (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.Process vs. Program — A
.exefile 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
- 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
- 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
- 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
- 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
- 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
- 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.
| Term | One-liner |
|---|---|
| PCB | OS data structure tracking all state for one process |
| Context switch | Save current PCB, restore next PCB — pure overhead |
| Race condition | Bug where outcome depends on thread execution order |
| Convoy effect | Long FCFS job at front forces all shorter jobs to wait |
| Aging | Gradually increasing a waiting process's priority to prevent starvation |
| Time quantum | Fixed CPU slice per process in Round Robin |
OS Course Notes — Weeks 3 & 5.md
Exam Timeline
AI · 출처 클릭
- 2026-04-22Midterm — Weeks 3–5 (Processes, Threads, IPC, Scheduling) at 14:00OS Course Notes — Weeks 3 & 5.md