CS FundamentalsVery hardGATE CS (PYQ pattern)
The enhanced clock algorithm uses (R, M) bits with 3 frames (initially empty, newly loaded pages get R = 1 and M = 1 if loaded by a write). On a fault the hand scans once from its position for a frame with (0,0); if none, it scans once for (0,1), clearing R on every frame it passes with R = 1; this pair of scans repeats until a victim is found; the hand then moves one past the victim. References (R = read, W = write): 1W, 2R, 3W, 4R, 1R, 5W, 2W, 3R, 6R, 1W, 4R, 5R. How many page faults and how many dirty write-backs occur?
- A. 11 faults, 4 write-backs
- B. 12 faults, 4 write-backs
- C. 11 faults, 5 write-backs
- D. 10 faults, 3 write-backs
Correct answer: A. 11 faults, 4 write-backs
Simulating the two-scan victim search with the hand moving past each victim gives 11 faults; of the evicted pages 4 were dirty.
More Operating Systems questions
- Page-fault-frequency control with threshold T = 3: on a fault at time t, if more than 3 time units passed since the previous fault, all…
- A disk head is at cylinder 50 at t = 0, moving towards higher cylinders, and needs 1 time unit per cylinder (service itself is…
- Round Robin with quantum 3 ms, three processes arriving at t = 0 with bursts (CPU, I/O, CPU) in ms: P0 (5, 4, 4), P1 (3, 6, 3), P2 (6, 2…
- Process P0 has 4 pages, each in its own frame. Copy-on-write fork is used (a frame is copied only when written while shared; a written…
- Shared x = y = 0. Thread 1: x = 1; y = 1. Thread 2: r1 = y; r2 = x. Thread 3: x = 2; r3 = x. Under sequential consistency, how many…
- A Unix file system contains only these names: directories /, /a, /a/b and /c, a regular file /a/f, and /c/g, which is a hard link to /a/f…