The Gateway to Computer Science Excellence
+1 vote
121 views

A system uses optimal policy for a page replacement. It has 4 page frames with no pages loaded to begin with. Consider the following scenario
Case-1: System first accesses 200 distinct pages in sequential order and then access same 200 distinct pages in same order.
Case-2: System first accesses 200 distinct pages in sequential order and then access same 200 distinct page in reverse order.
The difference in the number of faults occurred in both case are _________.

in Operating System by | 121 views
0
i think in both cases we will gate same number of PF
0
Yes, but how?

Can you please elaborate.
+1

Case:- 1...

here 1 to 4 (4PF)...after then....now we will repalce 4 ,5,6,7.....so on(becz upcoming element would be farthest than present 1,2,3...after servicing 0f 200 pages...remaining pages in PM would be 1,2,3,200...as we start from second loop 1,2,3 hit and then we will repalce 1,2,3,4,5,6..so on and 200 remain as it is becoz it is upcoming request.....therefor total 4 hit(1,2,3,200)...means (400-4=396PF)...

Case:- Same....u can imagine

1 Answer

+1 vote
by

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,345 questions
60,484 answers
201,816 comments
95,291 users