optional · CSS study notes
Process Management — Solved Numericals
CSS Optional — Paper-II, Section-A · P-II.III.II (numericals) · Worked past-paper problems for [Process Management]. Read the concepts page first (process states, PCB, scheduling algorithm comparison table) — this page is pure practice.
Numerical 1 — Round Robin Average Waiting & Turnaround Time (CSS 2017)
Q: Three processes P1(burst 24), P2(burst 7), P3(burst 10), all arriving at t=0, are scheduled with Round Robin, quantum = 4. Find average waiting time and average turnaround time.
t=0-4 : P1 (rem 20) t=19-23: P3 runs 4 (rem 2)
t=4-8 : P2 (rem 3) t=23-27: P1 runs 4 (rem 12)
t=8-12 : P3 (rem 6) t=27-29: P3 finishes (ran 2)
t=12-16: P1 (rem 16) t=29-33: P1 runs 4 (rem 8)
t=16-19: P2 finishes (ran 3)t=33-37: P1 runs 4 (rem 4)
t=37-41: P1 finishes (ran 4)
Completion: P1=41, P2=19, P3=29
Turnaround (TAT) = Completion − Arrival(0): P1=41, P2=19, P3=29
Average TAT = (41+19+29)/3 = 89/3 = 29.67
Waiting (WT) = TAT − Burst: P1=41−24=17, P2=19−7=12, P3=29−10=19
Average WT = (17+12+19)/3 = 48/3 = 16
Answer: Average WT = 16, Average TAT = 29.67.
Numerical 2 — Preemptive Priority + Round-Robin Gantt Chart (CSS 2022, 10 marks)
Six processes with priority, burst, and arrival times; a higher number = higher priority; ties at the same priority share the CPU Round-Robin with quantum 10; a preempted process is requeued at the back.
Gantt chart:
| P1 | idle | P2 | P3 | P2 | P3 | P4 | P2 | P3 | idle | P5 | P6 | P5 |
0 20 25 35 45 55 60 75 80 90 100 105 115 120
Result table (CT = completion, TAT = CT−Arrival, WT = TAT−Burst):
| Process | CT | TAT | WT |
|---|---|---|---|
| P1 | 20 | 20 | 0 |
| P2 | 80 | 55 | 30 |
| P3 | 90 | 60 | 35 |
| P4 | 75 | 15 | 0 |
| P5 | 120 | 20 | 10 |
| P6 | 115 | 10 | 0 |
Reasoning highlights: P1 runs alone until 20 (highest priority, sole ready process); the CPU idles 20-25 since nothing is ready; P2/P3 (tied priority 30) round-robin each other in 10-unit slices; P4 (priority 35) preempts that pair the instant it arrives at 60 and runs to completion since nothing outranks it; P5/P6 repeat the same preemption pattern at the end.
Numerical 3 — Threading Model Parallelism (CSS 2025)
Q: A process spawns 10 user-level threads, mapped by the threading library onto 2 kernel threads, running on an 8-core system. What is the maximum number of this process's threads that can execute in parallel?
Answer: 2. Even though 8 physical cores are free, only kernel threads are schedulable onto cores. The many-to-few (M:N, here 10:2) model caps true hardware parallelism at the number of kernel threads regardless of how many user threads exist or how many cores sit idle.
🎯 CSS Exam Angle
Process Management numericals are almost always Gantt-chart-based (compute CT/TAT/WT) or thread-model conceptual. Always draw the Gantt chart explicitly even if not asked — examiners award partial marks for a correct chart even when the final averages have an arithmetic slip. When arrival times differ (as in Numerical 2), explicitly state what happens when no process is ready (CPU idles) — a very common marks-losing omission.
⚠️ MCQ Traps
- RR quantum too large ≈ FCFS; quantum too small ⇒ throughput collapses from context-switch overhead.
- When priorities tie, check whether the question specifies Round-Robin among equals rather than assuming FCFS by default (Numerical 2's exact setup).
- Thread creation is cheap because it shares the parent's address space, not because threads "do less work."