The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+3 votes
123 views
Self doubt:

What is the rule or keyb point we should keep in mind while solving problems on LRU page replacement algorithm? Please explain with examples.
asked in Operating System by Active (1.2k points) | 123 views

1 Answer

+2 votes
Best answer

My definition about LRU is Replace the page which one is Long-ago Used

1) no.of pages already loaded in the memory

              given reference string is 1,2,4,5,6,1,2,3..... using demand-paging said  that already two pages brought in main memory 1 ,2 and 1 is brought before 2

          then

           in the reference string very first 1 and 2 are hits but not the page faults 

2) which page is long-ago used

            given reference string is 1,2,4,5,6,1,2,3..... think each reference is in different month first 1 is in jan, first 2 is in feb, 4 is in mar, 5 is in apr, 6 is in may, second 1 is June , second 2 is in July etc... if a hit occurs consider the page respective month is updated to new one ( 1 is June and 2 is July in this example ). if a page fault occurs replace the page with which have long-ago referred...

answered by Veteran (61.4k points)
selected by

Related questions

+1 vote
1 answer
4
+1 vote
1 answer
7
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
49,807 questions
54,504 answers
188,309 comments
74,889 users