CS FundamentalsVery hardGATE CS
Reference string 1, 2, 3, 1, 4, 5, 1, 6, 2, 1, 3, 4 with 3 frames, initially empty. The clock (second-chance) algorithm sets a page's reference bit to 1 when it is loaded or referenced, and the hand moves past a frame after replacing it. How many faults occur under clock, FIFO and LRU respectively?
- A. 9, 10, 9
- B. 10, 10, 9
- C. 10, 9, 9
- D. 9, 10, 10
Correct answer: B. 10, 10, 9
Simulation gives 10 faults for clock: the hit on 1 at time 4 is wiped out when the hand sweeps all three set bits before replacing it. FIFO also faults 10 times, while LRU, which keeps 1 longer, faults 9 times.
More Operating Systems questions
- TLB lookup 20 ns (done first), memory access 100 ns, single-level page table, TLB hit ratio 80%. In addition, 1 in every 1,000 memory…
- A bounded buffer uses semaphores empty = N, full = 0 and mutex = 1. The producer is changed to do wait(mutex) BEFORE wait(empty); the…
- Jobs A (6), B (2), C (8) and D (3) all arrive at time 0 in that order. What are the average waiting time under non-preemptive SJF and the…
- Under Linux CFS, two CPU-bound tasks share one CPU: one at nice 0 (weight 1024) and one at nice 5 (weight 335). About what share of CPU…
- A system's average process size is s = 1 MB and each page-table entry takes e = 8 bytes. Balancing page-table overhead (s·e / p) against…
- What does this program print? (Assume fork() succeeds and the exec of echo succeeds.) c int main() { fork(); execlp("echo", "echo", "hi"…