-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFIFO.html
77 lines (54 loc) · 3.48 KB
/
FIFO.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html>
<head>
<title>Page Replacement Algorithms</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link href="pagereplacementpage.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="icon-bar">
<a class="active" href="mainpage1.html"><i class="fa fa-home"></i></a>
<a href="homepage2.html">Create Charts</a>
<a href="jobschedulingpage.html">Job Scheduling Algorithms</a>
<a href="pagereplacementpage.html">Page Replacement Algorithms</a>
<a href="aboutuspage.html">About</a>
</div>
<div class="sidenav">
<a class="active" href="mainpage1.html"><i class="fa fa-home"></i></a>
<a href="pagereplacementpage.html">Optimal Page Repalcement</a>
<a href="NRU.html">NRU Page Replacement</a>
<a href="FIFO.html">FIFO Page Replacement</a>
<a href="SC.html">Second Chance Page Replacement</a>
<a href="LRU.html">LRU Page Replacement</a>
</div>
<div class="main">
<br>
<h4>First In First Out (FIFO) Page Replacement</h4>
This is the simplest page replacement algorithm. In this algorithm, operating system keeps track of all pages in the memory in a queue, oldest page is in the front of the queue.
When a page needs to be replaced page in the front of the queue is selected for removal.<br><br>
consider page reference string 1, 3, 0, 3, 5, 6 and 3 page slots.<br>
<ul>
<li>Initially all slots are empty, so when 1, 3, 0 came they are allocated to the empty slots = <b>3 Page faults</b></li>
<li>when 3 comes, it is already in memory so = <b>0 Page fault</b></li>
<li>Then 5 comes, it is not available in memory so it replaces the oldest page slot i.e 1 = <b>1 Page fault</b></li>
<li>Finally 6 comes, it is also not available in memory so it replaces the oldest page slot i.e 3 = <b>1 Page fault</b></li>
</ul>
Let us have a reference string: a, b, c, d, c, a, d, b, e, b, a, b, c, d and the size of the frame be 4.<br>
<br>
<img class="FIFO" src="FIFO.png"><br>
There are 9 page faults using FIFO algorithm.<br><br>
<ul>
<li><b>Beladys anomaly</b> : Belady’s anomaly proves that it is possible to have more page faults when increasing the number of page frames while using the First in First Out (FIFO) page replacement algorithm. For example, if we
consider reference string 3, 2, 1, 0, 3, 2, 4, 3, 2, 1, 0, 4 and 3 slots, we get 9 total page faults, but if we increase slots to 4, we get 10 page faults.</li>
<ul>
<br>
<br>
</div>
</body>
</html>