Operating system FIFO页面替换是如何工作的?
我试图理解FIFO页面替换算法,但我能找到的所有信息都是下面的内容。您能否解释一下如何使用引用字符串来评估页面替换算法(使用FIFO的特定示例) 当必须替换页面时,将选择最旧的页面 在我们所有的示例中,引用字符串是 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 3帧(9页错误) 4帧(10页错误)Operating system FIFO页面替换是如何工作的?,operating-system,page-replacement,Operating System,Page Replacement,我试图理解FIFO页面替换算法,但我能找到的所有信息都是下面的内容。您能否解释一下如何使用引用字符串来评估页面替换算法(使用FIFO的特定示例) 当必须替换页面时,将选择最旧的页面 在我们所有的示例中,引用字符串是 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 3帧(9页错误) 4帧(10页错误) 页面在队列中不可用时被替换 转到此链接 这里解释了所有页面的重新定位算法。很好的例子。您很容易理解。页面错误是指内存帧中不存在页面,因此必须向操作系统发送陷阱 页面必须添加到一
页面在队列中不可用时被替换 转到此链接
这里解释了所有页面的重新定位算法。很好的例子。您很容易理解。页面错误是指内存帧中不存在页面,因此必须向操作系统发送陷阱 页面必须添加到一个框架中。如果没有空间,那么需要移除一些东西。 FIFO是确定将删除哪个页面的一种方法 其概念是,首先添加到框架中的任何页面都将首先被删除。这就是FIFO的含义。使用您的第一个示例。我将进入引用字符串列表,并向您展示内存的外观
1: 1 +1 fault
2: 1,2 +1 fault
3: 1,2,3 +1 fault
4: 2,3,4 +1 fault - 1 gets removed because it was the first added
1: 3,4,1 +1 fault - 2 gets removed because it was the first on the list
2: 4,1,2 +1 fault - 3 got removed..
5: 1,2,5 +1 fault - 4 got removed..
1: 1,2,5 No change - 1 is already present so no page fault was required
2: 1,2,5 No change - 2 is already present in the frame
3: 2,5,3 +1 fault - 1 was removed because it is first
4: 5,3,4 +1 fault - Now 2 got removed
5: 5,3,4 No change - No change because 5 is present in one of the frames.
这总共给出了9个故障
您还可以将其视为最旧的页面被删除
希望我没有犯错误:D--------------先进先出*-------------
这个问题永远不会过时!
Page no. 1 | 1 +1
Page no. 2 | 1 2 +1
Page no. 3 | 1 2 3 +1
Page no. 4 | 1 2 3 4 +1
Page no. 1 |
Page no. 2 |
Page no. 5 | 2 3 4 5 +1
Page no. 1 | 3 4 5 1 +1
Page no. 2 | 4 5 1 2 +1
Page no. 3 | 5 1 2 3 +1
Page no. 4 | 1 2 3 4 +1
Page no. 5 | 2 3 4 5 +1
Page Faults = 10
1: 1 +1 fault
2: 1,2 +1 fault
3: 1,2,3 +1 fault
4: 2,3,4 +1 fault - 1 gets removed because it was the first added
1: 3,4,1 +1 fault - 2 gets removed because it was the first on the list
2: 4,1,2 +1 fault - 3 got removed..
5: 1,2,5 +1 fault - 1 got removed..
1: 1,2,5 No change - 1 is already present so no page fault was required
2: 1,2,5 No change - 2 is already present in the frame
3: 2,5,3 +1 fault - 1 was removed because it is first
4: 5,3,4 +1 fault - Now 2 got removed
5: 5,3,4 No change - No change because 5 is present in one of the frames.