Prev | Current Page 324 | Next

Carl Reynolds and Paul Tymann

"Schaum's Outline of Principles of Computer Science"


When a page fault occurs and one of the mapped pages must be replaced, the system checks the page table
entry pointed to by the clock hand. If the Referenced bit for that page is 0, it means that the page has not been
referenced since the last clock tick. In that case, that page of memory is written to the disk, if necessary (if it??™s
???dirty???), and that frame of memory is reallocated for the new page.
On the other hand, if the Referenced bit for the page pointed to by the clock hand is 1, it means that the
page has been accessed recently. Since recently accessed pages are more likely to be accessed in the near future,
it would be unwise to replace a recently used page. So the clock algorithm sets the Reference bit for the page
to 0, and moves to the next entry in the list. It continues in this manner until it finds an entry whose Referenced
bit is 0, and in that case it reallocates the frame for new use with the new page.
The clock algorithm is also called the ???second chance??? algorithm because sometimes a page comes up for
a second chance to be sacrificed. If the Referenced bits are set for all pages, then the pointer eventually will
point to the page it started with. Since it cleared the Referenced bit for this page the first time around, on the
second chance the page will be selected for replacement.


Pages:
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
chemia kosmetyki hotele w miedzyzdrojach Wizytówki Babia Góra drukarki fiskalne kraków Hauck Condor