Thursday 15 March 2012

caching - FIFO cache vs LRU cache -


I'm really sorry for such a simple question. I just want to make sure that I understand the fifo cache model correctly and I hope someone will help me: The LRU cache removes the entry that was recently used if cash is full. FIFO removes the entry that compares to the other entries (?) If the cache requires an empty space (for example if 'A' - 'V' - 'F' - 'in' cache Entries are and 'A' is the oldest entry, then the cash will remove 'A' if it will need an empty space).

Am I right?

You're right.

Think of FIFA, the first car going to the tunnel will be the first to go out on the other side.

Think of LRU cache as a garage cleaning. You will throw things that you have not used for long periods of time, and keep them often used. The development of that algorithm (Improvement in simple LRU) will have to throw those items which have not been used for long periods, and if you require it is not expensive to replace them.

No comments:

Post a Comment