103k views
5 votes
Consider the pages referenced by the CPU in the order 6, 7, 8, 9, 6, 7, 1, 6, 7, 8, 9, 1. Let there be 3 frames in the memory. Find the page fault ratio using:

(a) FCFS
(b) OPT
(c) LRU

User Artavia
by
7.7k points

1 Answer

2 votes

Final Answer:

(a) FCFS: Page fault ratio is 5/12, (b) OPT: Page fault ratio is 3/12, (c) LRU: Page fault ratio is 4/12.

Step-by-step explanation:

(a) FCFS (First Come First Serve) considers the order of page references. In the given sequence, there are 5 page faults out of 12 total references, resulting in a page fault ratio of 5/12.

(b) OPT (Optimal) algorithm predicts future page references and selects the page that will not be used for the longest period. In the provided sequence, OPT results in 3 page faults out of 12, leading to a page fault ratio of 3/12.

(c) LRU (Least Recently Used) replaces the least recently used page. In the given sequence, LRU yields 4 page faults out of 12, resulting in a page fault ratio of 4/12.

Option A (FCFS), B (OPT), C (LRU) is the answer.

User Aderstedt
by
8.3k points