Two Handed Clock Page Replacement
In UNIX, memory management all of the available free frames are linked together. If the number of available frames is more than the pages, then the remaining frames are used by the kernel. In Two-Handed Clock Page Replacement, the reference bit of each page in the page table specifies whether the page is first loaded in the main memory or referenced. If the page is first loaded in main memory then reference bit=0, when the page is referenced or used at least once then reference bit=1.
The front hand identifies the free frames and loads the page in the free frame then set the reference bit=0, after some time the backhand visits the frame if the page is referenced during the time interval between the front hand and backhand then it can not be replaced. Otherwise, is eligible to replace, therefore.
- If reference bit=1 then not eligible for replacement
- If reference bit=0 then eligible for page replacement.
The performance of this algorithm is based on two parameters. These are:
1. Scan Rate: Scan rate specifies, the rate at which the two hands scan.
2. Hard Gap: Hard gap specifies the gap between the front hand and backhand.