recategorized by
2,424 views
0 votes
0 votes

​​​​​​​Suppose for a process $P$, reference to pages in order are $1, 2, 4, 5, 2, 1, 2, 4$. Assume that main memory can accomodate $3$ pages and the main memory has already $1$ and $2$ in the order $1$ – first, $2$ – second. At this moment, assume FIFO Page Replacement Algorithm is used then the number of page faults that occur to complete the execution of process $P$ is

  1. $4$
  2. $3$
  3. $5$
  4. $6$
recategorized by

1 Answer

0 votes
0 votes
Initially,   $1|2$

The requests are :

$1\rightarrow 1|2$

$2\rightarrow 1|2$

$4\rightarrow 1|2|4,\,\, Page fault=1$

$5\rightarrow 2|4|5,\,\, Page fault=2$

$2\rightarrow 2|4|5,\,\, Page fault=2$

$1\rightarrow 4|5|1,\,\, Page fault=3$

$2\rightarrow 5|1|2,\,\, Page fault=4$

$4\rightarrow 1|2|4,\,\, Page fault=5$

So, $(C)$ should be the answer

Related questions

8.5k
views
1 answers
3 votes
go_editor asked Aug 16, 2016
8,494 views
Consider the reference string:0 1 2 3 0 1 4 0 1 2 3 4If FIFO page replacement algorithm is used, then the number of page faults with three page frames and four page frames are ____ and ___ respectively.10, 99, 910, 109, 10
589
views
1 answers
2 votes
admin asked Dec 15, 2022
589 views
Compute the hit rate and miss/fault rate in least recently used page replacement algorithm for the given reference string with $4$ page frames. String: $7 \; 0 \; 1 \; 2 \; 0 \; 3 \; 4 \; 2 \; 3 \; 0 \; 3 \; 2 \; 1 \; 2 \; 0 \; 1$
11.5k
views
4 answers
23 votes
admin asked Feb 15, 2023
11,468 views
Consider the following two-dimensional array $\text{D}$ in the $\text{C}$ programming language, which is stored in row-major order:int D[128] ... number of page faults generated during the execution of this code snippet is _______________.