recategorized by
4,552 views
5 5 votes

Determine the number of page faults when references to pages occur in the order $1,2,4,5,2,1,2,4.$ Assume that the main memory can accommodate $3$ pages and the main memory already has the pages $1$ and $2,$ with page $1$ brought earlier than page $2.$ (assume LRU i.e., Least-Recently-Used algorithm is applied)

  1. $3$
  2. $4$
  3. $5$
  4. None of the above

3 Answers

2 2 votes

The main memory already has the pages $1$ and $2$, with page $1$ brought earlier than page $2.$ It means $1,2$  is ${\color{Magenta}{\textbf{not}}}$ a page fault.

$1,2,4,5,2,1,2,4.$

Using LRU(Least -  Recently -  Used) algorithm we got $4$ page faults.

So, the correct answer is $(B).$

Answer:
Position:
Show:

Related questions

2 2 votes
2 answers 2 answers
1.7k
1.7k views
Arjun asked Apr 22, 2018
1,684 views
Determine the number of page faults when references to pages occur in the order - $1, 2, 4, 5, 2, 1, 2, 4$. Assume that the main memory can accommodate $3$ pages and the ...
5 5 votes
3 answers 3 answers
14.0k
14.0k views
Arjun asked Apr 22, 2018
14,012 views
The following $C$ program:{ fork(); fork(); printf("yes"); }If we execute this core segment, how many times the string yes will be printed?Only once2 times4 times8 times
4 4 votes
3 3 answers
5.2k
5.2k views
Arjun asked Apr 22, 2018
5,184 views
The difference between a named pipe and a regular file in Unix is thatUnlike a regular file, named pipe is a special fileThe data in a pipe is transient, unlike the conte...
6 6 votes
5 answers 5 answers
9.1k
9.1k views
Arjun asked Apr 22, 2018
9,122 views
Consider a system having $m$ resources of the same type. These resources are shared by $3$ processes $A, B, C,$ which have peak time demands of $3, 4, 6$ respectively. Th...