câu 31
Answer:
Step 1 of 3
Page Replacement:
In the least recently used page replacement algorithm, the pointer moves to the frame which has the least frequency and is low on memory load. This algorithm is efficient but due to search sequence, it consumes time more than other defined algorithms.
Consider the reference string 0 1 2 1 2 0 3
Frame size=3 pages
The LRU is shown below:
Therefore, the page 1 will be replaced by page 3. The number of page faults occurred in an LRU is 4.
Step 2 of 3
In the clock page replacement algorithm, the page frames are arranged in a circular sequence. The pointer refers to the current frame in use.
• When a page fault occurs, the page being pointed to by the hand is inspected.
• If the R is 0, the new page is inserted, and hand is moved to next page.
• If the R is 1, clear the R and the hand is advanced to the next page.
• The values of the pointer should be set to 1 each time the page is referenced.
• When there is a fault then the router walks through the circular list and if the value is 0 it takes the frame else it resets the bit and moves to the next frame.
Consider the reference string 0 1 2 1 2 0 3
Frame size=3 pages
Step 3 of 3
