Discussion
Which of these describes the second-chance (clock) page replacement algorithm?
Answer: D
Correct answer: FIFO order, but a page with its reference bit set is spared and the bit cleared
The second-chance algorithm is FIFO with one modification. When a page reaches the head of the queue, its reference bit is examined: if the bit is 0 the page is replaced, and if it is 1 the bit is cleared and the page is given another chance, moving to the back of the queue as though newly loaded. Implemented as a circular queue with a pointer sweeping round it, this is known as the clock algorithm, and the pointer is the clock hand. Its purpose is to approximate LRU at almost no cost. True LRU needs a timestamp or a stack updated on every memory reference, which is too expensive; the reference bit is set by hardware for free, and one bit is enough to distinguish pages used recently from pages not used at all. An enhanced version considers the dirty bit as well, preferring to evict pages that are both unreferenced and unmodified, since those need no write-back. Most real operating systems use some variant of it.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development