Figure 1 shows a linked list for memory management. The reference bit for these
ID: 3739345 • Letter: F
Question
Figure 1 shows a linked list for memory management. The reference bit for these eight pages is 1,1,1,1,0,0,0 coorespondingly(1)Assume the second chance page replacement is used. Which page will be replaced by new page I when page fault occurs?
Page loaded first Most recently loaded page Time 0 3 7 8 12 14 15 18 Fig. 1. Fig. I shows a linked list for memory management. The ref erence bit for these eight pages is l, l. 1,1. ?, O, O, O. correspondingly () Assume the second chance page replacement is used. Which page will be replaced by new page I when page fault occurs? Answer: Updated linked list is: (2) Assume FIFO page replacement is used. Which page will be replaced by new page I when page fault occurs? Answer Updated linked list is:
Explanation / Answer
Reference bit for eight pages is 1, 1 , 1, 1 ,0 , 0, 0, 0
1) In the second chance page replacement algorithm, pages with reference bit 1 gets a second chance when page fault occurs whereas page with reference bit 0 gets replaced by new page.
Page A has arrived at time 0 and has reference bit 1
Page B has arrived at time 3 and has reference bit 1 and so on
When page I arrives and page fault occurs, page A is the victim for replacement but as it has referenced bit 1 it will get second chance and will not be replaced. Reference bit of page A becomes 0 and it gets added at end of linked list.
Similarly, after A page B becomes victim but as it also has reference bit 1, it will also get second chance and reference bit will set to 0 and page gets added to end of linked list.
Similarly, page C and page D gets reference bit 0.
Next comes page E which becomes victim for replacement. As it has refernce bit 0 , it will be replaced by page I.
So, Page E gets replaced by page I
Updated linked list : F-> G -> H -> A-> B ->C ->D ->I
b) If FIFO page replacement is used ,page at head of list will be replaced and new page gets added at the end of linked list.
Page A will be replaced by new page I when page fault occurs as page A arrived at time 0 and is at head of list.
Page I gets added to end of linked list.
Updated linked list : B- > C-> D -> E ->F -> G -> H -> I
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.