FIFOページ置換アルゴリズムを理解しようとしていますが、見つけることができるすべての情報は以下のとおりです。FIFOの特定の例を使用して、参照文字列を使用してページ置換アルゴリズムを評価する方法を説明できますか?
ページを置き換える必要がある場合は、最も古いページが選択されます。
すべての例で、参照文字列は
1、2、3、4、1、2、5、1、2、3、4、5
3フレーム(9ページフォールト)4フレーム(10ページフォールト)
FIFOページ置換アルゴリズムを理解しようとしていますが、見つけることができるすべての情報は以下のとおりです。FIFOの特定の例を使用して、参照文字列を使用してページ置換アルゴリズムを評価する方法を説明できますか?
ページを置き換える必要がある場合は、最も古いページが選択されます。
すべての例で、参照文字列は
1、2、3、4、1、2、5、1、2、3、4、5
3フレーム(9ページフォールト)4フレーム(10ページフォールト)
ページフォールトとは、ページがメモリのフレームに存在しないため、トラップをOSに送信し、ページをフレームに追加する必要がある場合です。余地がない場合は、何かを削除する必要があります。FIFOは、どのページが削除されるかを決定する1つの方法です。
コンセプトは、フレームに最初に追加されたページが最初に削除されるというものです。これが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
キューで利用できない場合、ページは置き換えられます。
このリンクFIFOに移動します
ここでは、すべてのページrepalacemntアルゴについて説明しました。例を挙げれば非常にうまくいきます。あなたは簡単に理解します。
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.