Cache algorithms Flashcards
How to solve FIFO Algorithm?
Replace the one that has been in the queue the longest
Put Fault when need to replace
How to solve LRU Algorithm?
Put Fault when need to replace
1)Replace the one that has been in the queue the longest at start
2)Replace one which is least recently used
Circle when you put in new
Circle when repeats
How to solve OPT Algorithm?
Put Fault when need to replace
Replace whichever slot is furthest in the future to appear
If not repeating then replace
How to solve CLOCK Algorithm?
Put Fault when need to replace
Has pointer
Add star when u add new value
Only value without star can be replaced, so then remove star then move pointer
if value is repeated and doesn’t have star then Add star
How can we compare Cache Algorithms?
One closest to the OPT
1) Highest Hit Ratio
2) Lowest Fit Ratio