a simple modification to FIFO that avoids the problem of throwing out a heavily used page is to inspect the R bit of the oldest page. If it is 0, the page is both old and unused, so it is replaced immediately. If the R bit is 1, the bit is cleared, the page is put onto the end of the list of pages, and its load time is updated as though it had just arrived in memory.Then search continues. The operation of this algorithm is called second chance algorithm.
FIFO is first in, first out i know its working type. The data which enters the queue firstly will be exit first. If i want to implement second chance algorithm with FIFO there will be a question about r_bit variable , i must controll if the array's elements' r_bit is 1 or 0 ?
how can i do that?