CS FundamentalsVery hardGATE CS (PYQ pattern)
A CFS-like scheduler picks the runnable task with the smallest virtual runtime and runs it for a 4 ms slice, then adds 4 x 1024 / weight to its vruntime. Tasks A, B, C have weights 1024, 2048 and 512, all vruntimes start at 0 and ties go to the earlier task. How many of the first 28 slices does B get?
- A. 8
- B. 4
- C. 16
- D. 18
Correct answer: C. 16
Slice counts over 28 picks are A 8, B 16, C 4: exactly the weight ratio 2 : 4 : 1 over 28 picks; B advances its vruntime slowest, so it is picked most often.
More Operating Systems questions
- Three tasks share two resources under the priority ceiling protocol (priorities t1 > t2 > t3). t3 has a 4 ms critical section on R1 and a…
- Rate-monotonic tasks (C, T = D, worst-case blocking B): t1 (2, 5, 2), t2 (2, 8, 2), t3 (4, 12, 0). Response time R = C + B + sum over…
- Eight independent jobs with lengths 7, 6, 5, 5, 4, 3, 3, 2 are scheduled on 3 identical processors by LPT (longest job first onto the…
- Rate-monotonic tasks (C, period = deadline) T1 (1, 3), T2 (1, 5), T3 (3, 15) are released together at t = 0. How many times is T3…
- Two CPU-bound processes alternate on one core, 100 context switches per second. Each has a 40-page working set in the TLB (64 entries)…
- A thread runs on node 0 of a 4-node NUMA machine. Access latency is 80 ns to node 0, 140 ns to nodes 1 and 2 (one hop) and 200 ns to node…