CS FundamentalsVery hardGATE CS
Two processes each alternate CPU and I/O: P1 = CPU 4, I/O 6, CPU 2; P2 = CPU 3, I/O 3, CPU 5 (ms). Both arrive at 0, P1 first; scheduling is FCFS on one CPU and each process has its own I/O device (I/O runs in parallel). When does the last process finish, and what is the CPU idle time in that interval?
- A. 14 ms and 0 ms
- B. 23 ms and 9 ms
- C. 17 ms and 0 ms
- D. 17 ms and 3 ms
Correct answer: D. 17 ms and 3 ms
CPU: P1 0–4, P2 4–7. P2's I/O runs 7–10, P1's I/O 4–10. At 10 both are ready; P1 (queued first, its I/O ended at the same time) runs 10–12, P2 12–17. CPU idle 7–10 = 3 ms; all done at 17.
More Operating Systems questions
- Reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0, 1. With 3 frames (initially empty), what are the page-fault…
- Reference string: 1, 2, 1, 3, 1, 2, 4, 5, 4, 2, 5, 3, 4, 2, 3 frames, initially empty. LFU replacement is used: the victim is the resident…
- Reference string: 0, 4, 1, 4, 2, 4, 3, 4, 2, 4, 0, 4, 1, 4, 2, 4, 3, 4. How many page faults does LRU give with 2, 3, 4 and 5 frames…
- TLB access 2 ns (looked up first), memory access 50 ns, two-level page table, TLB hit ratio 98%. A fraction 10⁻⁵ of ALL accesses…
- A machine has 57-bit virtual addresses (5-level paging style), 4 KB pages and 8-byte page-table entries, with every page table fitting in…
- A system has 46-bit virtual addresses, 16 KB pages and 4-byte PTEs; each page table must fit in one page. How many levels of page tables…