-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
214 lines (170 loc) · 10.5 KB
/
index.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE HTML>
<html>
<head>
<title>Process Scheduler</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
</head>
<body class="is-preload">
<!-- Header -->
<section id="header">
<header>
<span class="image avatar"><img src="images/processe.png" alt="" /></span>
<h1 id="logo"><a href="#">Process Scheduling Algorithms</a></h1>
<br />
</header>
<nav id="nav">
<ul>
<li><a class="icon solid fa-home" href="#one" class="active">Home</a></li>
<li><a class="icon solid fa-cog" href="#two">Process Scheduler</a></li>
<li><a class="icon solid fa-retweet" href="#three">Scheduling Algorithms</a></li>
</ul>
</nav>
</section>
<!-- Wrapper -->
<div id="wrapper">
<!-- Main -->
<div id="main">
<!-- One -->
<section id="one">
<div class="container">
<header class="major">
<h2>Process Scheduling Algorithms</h2>
</header>
<p>CPU scheduling is a technique used by operating systems to manage the allocation of the CPU's processing time to the various processes or threads that are competing for it. A CPU scheduling algorithm is a method used by the operating system to determine which process should be given access to the CPU next. The selection process will be carried out by the CPU scheduler. It selects one of the processes in memory that are ready for execution.</p>
</div>
</section>
<!-- Two -->
<section id="two">
<div class="container">
<h2>Process Scheduler</h2>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<h3>Algorithms : </h3>
<form id="algorithms">
<input type="radio" name="algo" id="fcfs" checked> <label for="fcfs">FCFS</label> <br>
<input type="radio" name="algo" id="sjf"> <label for="sjf">SJF</label> <br>
<input type="radio" name="algo" id="ljf"> <label for="ljf">LJF</label> <br>
<input type="radio" name="algo" id="rr"> <label for="rr">Round Robin</label> <br>
<input type="radio" name="algo" id="srjf"> <label for="srjf">SRTF</label> <br>
<input type="radio" name="algo" id="lrjf"> <label for="lrjf">LRTF</label> <br>
<input type="radio" name="algo" id="hrrn"> <label for="hrrn">HRRN</label> <br>
</form>
<br>
<table class="main-table">
<thead>
<tr>
<th class="process-id">Process ID</th>
<th class="priority hide">Priority</th>
<th class="arrival-time">Arrival Time</th>
<th class="process-time"colspan="1">Burst Time</th>
</tr>
</thead>
<tbody>
<tr>
<td class="process-id" rowspan="2">P1</td>
<td class="priority hide" rowspan="2"><input type="number" min="1" step="1" value="1"></td>
<td class="arrival-time" rowspan="2"><input type="number" min="0" step="1" value="0"> </td>
<td class="process-time cpu process-heading" colspan="">CPU</td>
</tr>
<tr>
<td class="process-time cpu process-input"><input type="number" min="1" step="1" value="1"> </td>
</tr>
</tbody>
</table>
<div id="time-quantum" class="hide">
<br>
<label for="tq">Time Quantum : </label>
<input type="number" name="Time Quantum" id="tq" min="1" step="1" value="2">
</div>
<br>
<button type="button" class="add-btn"><b>Add</b></button>
<button type="button" class="remove-btn"><b>Delete</b></button>
<button type="button" class="calculate"><b>Run</b></button>
<div id="output"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="script.js"></script>
</div>
<!-- Three -->
<section id="three">
<div class="container">
<h3>Scheduling Algorithms</h3>
<p>In a multi-tasking operating system, multiple processes may be running simultaneously, and the CPU must allocate time to each of these processes. The CPU scheduling algorithm plays a crucial role in determining how efficiently the system uses the CPU and how responsive it is to user requests.
CPU scheduling algorithms can be preemptive or non-preemptive. In preemptive algorithms, the currently executing process can be interrupted if a higher-priority process arrives or if the current process exceeds its allotted time slice. In non-preemptive algorithms, a process will continue to execute until it releases the CPU voluntarily.
The performance of a CPU scheduling algorithm can be evaluated based on several metrics, such as turnaround time, waiting time, and response time. The goal is to minimize these metrics and ensure that the system is responsive and efficient. Different scheduling algorithms may be more suitable for different types of workloads, and the choice of algorithm may depend on factors such as system utilization, average process run time, and user requirements.</p>
<div class="features">
<article>
<div class="box">
<h4>First Come First Serve (FCFS)</h4>
<p>First-Come, First-Served (FCFS) is the simplest CPU scheduling algorithm, where the processes are executed in the order they arrive in the ready queue. The process that enters the queue first gets the CPU first, and the other processes wait in a queue until the currently running process completes its execution. In this type of algorithm, processes which requests the CPU first get the CPU allocation first.
This is managed with a FIFO queue.</p>
</div>
</article>
<article>
<div class="box">
<h4>Shortest Job First (SJF)</h4>
<p>Shortest Job First is a scheduling policy that selects the waiting process with the smallest execution time to execute next. It is a non-preemptive and Greedy algorithm.
Shortest Job first has the advantage of having a minimum average waiting time among all scheduling algorithms.
It may cause starvation if shorter processes keep coming.</p>
</div>
</article>
<article>
<div class="box">
<h4>Shortest Remaining Time First (SRTF)</h4>
<p>This Algorithm is the preemptive version of SJF scheduling. In SRTF, the execution of the process can be stopped after certain amount of time.
At the arrival of every process, the short term scheduler schedules the process with the least remaining burst time among the list of available processes and the running process.</p>
</div>
</article>
<article>
<div class="box">
<h4>Highest Response Ratio Next (HRRN)</h4>
<p>Prerequisite – CPU Scheduling
Given n processes with their Arrival times and Burst times, the task is to find average waiting time and average turn around time using HRRN scheduling algorithm.
The name itself states that we need to find the response ratio of all available processes and select the one with the highest Response Ratio.
A process once selected will run till completion.</p>
</div>
</article>
<article>
<div class="box">
<h4>Longest Job First (LJF)</h4>
<p>Longest Job First is a non-preemptive scheduling algorithm.
This algorithm is based upon the burst time of the processes.
The processes are put into the ready queue based on their burst times i.e., in a descending order of the burst times.
As the name suggests this algorithm is based upon the fact that the process with the largest burst time is processed first.
The burst time of only those processes is considered that have arrived in the system until that time.</p>
</div>
</article>
<article>
<div class="box">
<h4>Longest Remaining Time First (LRTF)</h4>
<p>Prerequisite – Process Management & CPU Scheduling
This is a pre-emptive version of Longest Job First (LJF) scheduling algorithm. In this scheduling algorithm, we find the process with the maximum remaining time and then process it.
We check for the maximum remaining time after some interval of time(say 1 unit each) to check if another process having more Burst Time arrived up to that time.</p>
</div>
</article>
<article>
<div class="box">
<h4>Round Robin Scheduling</h4>
<p>Round Robin is the preemptive process scheduling algorithm.
Each process is provided a fix time to execute, it is called a quantum.
Once a process is executed for a given time period, it is preempted and other process executes for a given time period.
Context switching is used to save states of preempted processes.</p>
</div>
</article>
</div>
</div>
</section>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>