CS FundamentalsVery hardGATE CS
Cylinders 0–49, head at 20, previous request was at 25 (so the head is moving toward 0). Requests: 10, 22, 20, 2, 40, 6, 38. What is the total head movement under SSTF and under LOOK?
- A. 56 and 60
- B. 60 and 58
- C. 60 and 56
- D. 146 and 56
Correct answer: C. 60 and 56
SSTF order: 20, 22, 10, 6, 2, 38, 40 (the request at 20 costs nothing), total 60. LOOK moving down: 20 → 2 (18) then up to 40 (38) = 56.
More Operating Systems questions
- A disk spins at 15,000 RPM; average seek is 3.5 ms; transfer rate is 200 MB/s. What is the average time for a random 64 KB read?
- How many times is "x" printed? (Every fork() succeeds.) c int main() { if (fork() == 0) { if (fork() == 0) fork(); } printf("xn"); }
- How many times is "x" printed? (Every fork() succeeds.) c int main() { for (int i = 0; i < 2; i++) { fork(); fork(); } printf("xn"); }
- How many times is "x" printed? (Every fork() succeeds.) c int main() { if (fork() || fork()) fork(); printf("xn"); }
- Semaphores a = 1, b = 0. P: wait(a); print 1; signal(b); signal(b). Q: wait(b); print 2; signal(a). R: wait(b); print 3. Each runs once…
- Shared x = 1. T1 does x = x + 1; T2 and T3 each do x = x 2; (load, compute, store, no locks). How many distinct final values of x are…