Short answer: The clock algorithm, or second chance, approximates LRU with a circular list of frames and one reference bit each. The clock hand walks the circle. A frame whose bit is 1 gets the bit cleared and a second chance. A frame whose bit is 0 is evicted.…
Category: Systems
How the banker’s algorithm tests a safe state
Short answer: The banker’s algorithm avoids deadlock by refusing a resource request that would leave the system in an unsafe state. A state is safe when there exists an order of the processes such that each one can obtain its declared maximum with the resources free at its turn,…
How LRU replaces the least recently used page
Short answer: LRU page replacement evicts the page whose last use is oldest. It is the optimal policy among policies that do not see the future, in the sense of the stack property: a larger memory never causes more misses than a smaller one on the same trace. Implementing…
