As in the clock algorithm, for each missing page error, the page pointed to by the arrow is checked first. If the R bit is set to 1, then the page has been used during the current clock, so it is not an ideal candidate for deletion. Then the R bit is set to 0, the arrow moves to the next page, and the algorithm is repeated already for it. The state resulting from this sequence of events. Now let's see what happens if the page pointed to by the arrow has bit R = 0, as shown in Fig. If its age exceeds t and the page has not been modified, it does not belong to the working set and its exact copy is present on disk. Then a new page is simply placed in the page block. On the other hand, if the page has been changed, its block cannot be immediately claimed, since there is no exact copy of it on disk.
To avoid switching the process, the disk write is scheduled, and the arrow moves further and the algorithm continues its work on the next page. In the end, you should get an old, unchanged page, which you can use right away. In principle, a disk I/O operation for all pages can be scheduled in one clockwise rotation. To reduce the flow of data exchange with the disk, a limit can be set, which allows a maximum of n pages to be dumped to the disk. After this limit is reached, no more writes to the disk are scheduled.
-