FIFO Page Replacement Algorithm

FIFO in OS

FIFO Page Replacement Algorithm

 

FIFO is an acronym for First in First out approach. The concept is based on the fact that the elements present in the stack are removed following the same order in which they were filled. Precisely, the element present at the bottom of the stack will be removed first. This also means the element present on the top of the stack will be removed last.

Definition

FIFO is an acronym for First in First out approach. The concept is based on the fact that the elements present in the stack are removed following the same order in which they were filled. Precisely, the element present at the bottom of the stack will be removed first. This also means the element present on the top of the stack will be removed last.

Example

FIFO

Algorithm for FIFO Page Replacement

  • Step 1. Start to traverse the pages.
  • Step 2. f the memory holds fewer pages then the capacity go to Step 3, else go to Step 5.
  • Step 3. Push pages in the queue one at a time until the queue reaches its maximum capacity or all page requests are fulfilled.
  • Step 4. If the current page is present in the memory, do nothing.
  • Step 5. Else, pop the topmost page from the queue as it was inserted first.
  • Step 6.  Replace the topmost page with the current page from the string.
  • Step 7. Increment the page faults.