Operating System - How FIFO, LRU And Optimal Algorithms Work?

3

3 Answers

Chetan Agrawal Profile
Chetan Agrawal answered
These are types of page replacement algorithms. They work through paging via virtual memory management, wherein the algorithms choose which pages of a memory are to be written on to a disk or exchanged in order to allot space on a computer’s drive. The process of paging occurs when there is a page fault and the system is unable to free a page in to allocate space or memory.

There are different kinds of page replacement algorithms: The theoretically optimal page replacement algorithm, also known as clairvoyant, OPTS, or Belady’s, works when the operating system interchanges the page to the end when its next use is furthest in order to allocate a page. Another kind is the NRU or not recently used algorithm, which prefers to store recently-used pages in a computer’s memory.

The FIFO or first-in first-out algorithm, on the other hand, is the simplest form of page replacement algorithms. It works simply by keeping the most recently arrived pages at the back while the earliest arrivals stay at the front of the queue.

A more developed version of the FIFO is the second-chance page replacement algorithm, which similarly to the FIFO, checks the front of the queue, but first inspects the referenced bit before it pages out the page.

Another kind is the clock, which retains a circular list of its pages and its iterator, which acts as the hand, helps it know where the oldest page in the list by pointing to it. There are variants of the clock algorithm such as the GClock, Clock-Pro, WSclock, and the CAR. The LRU or least recently used page algorithm operates with the principle that pages heavy on the last few orders are most likely to be used heavily for the next few set of instructions as well. It has other varieties such as the LRU-K and the ARC.
Anonymous Profile
Anonymous answered
How the algorithms optimal 1,2,3,3,5,1,2,2,6,2,1,5,7,6,3 for following page reference string
Anonymous Profile
Anonymous answered
What is virtual memory concept . How is it implemented

Answer Question

Anonymous