CS FundamentalsHardProduct-company MCQ pattern
Processes: P1 (arrival 0, burst 7), P2 (arrival 2, burst 4), P3 (arrival 4, burst 1), P4 (arrival 5, burst 4) (ms), scheduled by SRTF. Not counting the initial dispatch at t = 0 or the switch away from the last process when it finishes, how many context switches occur?
- A. 6
- B. 3
- C. 4
- D. 5
Correct answer: D. 5
Gantt: P1 0–2 | P2 2–4 | P3 4–5 | P2 5–7 | P4 7–11 | P1 11–16. Switches at 2, 4, 5, 7 and 11 = 5. P4 arriving at 5 does not preempt P2 (remaining 2 < 4), a common miscount.
More Operating Systems questions
- A disk rotates at 7,200 RPM, has 400 sectors of 512 bytes per track, and an average seek time of 5 ms. What is the average time to read 4…
- Two processes use this code for mutual exclusion; turn is shared and starts at 0. Which property does it FAIL? c // Process i (i = 0 or 1)…
- Producer–consumer with semaphores mutex = 1, empty = N, full = 0. The producer is written as: c wait(mutex); wait(empty); / add item /…
- Match each scheduling algorithm with its property: (P) Round Robin (Q) SRTF (R) Multilevel feedback queue (S) FCFS (1) Moves processes…
- How many of the following statements are correct? 1. On a context switch, the TLB must be flushed unless its entries carry an…
- A 16 GB disk is formatted with 4 KB blocks and a File Allocation Table (FAT) that has one 4-byte entry per block. How large is the FAT…