in CO and Architecture
444 views
0 votes
0 votes
In LRU policy for cache replacement. the least recently used block is replaced. So, what happens when all the slots are empty at beginning?

Is LRU or MRU easier to implement? Why?
in CO and Architecture
by
444 views

1 comment

Replacement policy are used when all the positions that a new block may occupy in a cache are full or occupied by old blocks . As in question cache slots are empty so in beginning there is no need of replacement policy  and if need arises after some blocks are brought into cache than LRU is easier to implement because it choose the best block to be removed which is least recently used.( I tried is it right ,Sir ).

0
0

1 Answer

0 votes
0 votes
No need for replacement initially as they are already empty. we see replacement when the memory is full. And the second one i think both are of same cost in implementation. just a guess.

2 Comments

yes, first part is correct and I guess if asked like this most people get it right. But it created a lot of confusion for the 2014 GATE question.

For the second part, which requires more storage- LRU or MRU?
0
0
Sir, Is MRU easier to implement? I just guess so because extra Data Structure is needed in LRU. But in MRU, last block placed is to be replaced.
0
0

Related questions