Cache algorithms Flashcards

1
Q

How to solve FIFO Algorithm?

A

Replace the one that has been in the queue the longest

Put Fault when need to replace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to solve LRU Algorithm?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to solve OPT Algorithm?

A

Put Fault when need to replace

Replace whichever slot is furthest in the future to appear
If not repeating then replace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to solve CLOCK Algorithm?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can we compare Cache Algorithms?

A

One closest to the OPT

1) Highest Hit Ratio
2) Lowest Fit Ratio

How well did you know this?
1
Not at all
2
3
4
5
Perfectly