-
Notifications
You must be signed in to change notification settings - Fork 6
/
docs.html
332 lines (267 loc) · 15.8 KB
/
docs.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
<link rel="stylesheet" href="./docs.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>OS Virtual Lab</title>
</head>
<body>
<section class="sub-header">
<nav>
<a href="index.html">OS LAB</a>
<div class="nav-links" id="navLinks">
<i class="fas fa-window-close" onclick="hideMenu()"></i>
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="docs.html">DOCS</a></li>
<!-- <li><a href="blog.html">BLOG</a></li> -->
<li><a href="./backend/ganttcharts.html">SIMULATOR</a></li>
<li><a href="about.html">ABOUT</a></li>
</ul>
</div>
<i class="fas fa-bars" onclick="showMenu()"></i>
</nav>
<h1>Documentation</h1>
</section>
<section class="container_docs" >
<h1>What is CPU Scheduling?</h1>
<p>CPU Scheduling is a process of determining which process will own CPU for execution while another process is
on hold. The main task of CPU scheduling is to make sure that whenever the CPU remains idle, the OS at least
select one of the processes available in the ready queue for execution. 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>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>Why CPU Scheduling?</h1>
<p>A typical process involves both I/O time and CPU time. In a uni programming system like MS-DOS, time spent
waiting for I/O is wasted and CPU is free during this time. In multi programming systems, one process can
use CPU while another is waiting for I/O. This is possible only with process scheduling.<br><br>
<strong>Objectives of Process Scheduling Algorithm</strong>
<li>Max CPU utilization [Keep CPU as busy as possible]</li>
<li>Fair allocation of CPU.</li>
<li>Max throughput [Number of processes that complete their execution per time unit]</li>
<li>Min turnaround time [Time taken by a process to finish execution]</li>
<li>Min waiting time [Time a process waits in ready queue]</li>
<li>Min response time [Time when a process produces first response]</li>
</p>
</section>
<section class="container_docs special" data-aos="zoom-in-up">
<h1>Important CPU scheduling Terminologies</h1>
<!-- <p>A typical process involves both I/O time and CPU time. In a uni programming system like MS-DOS, time spent waiting for I/O is wasted and CPU is free during this time. In multi programming systems, one process can use CPU while another is waiting for I/O. This is possible only with process scheduling.<br><br> -->
<li><strong>Burst Time/Execution Time:</strong> It is a time required by the process to complete execution. It
is also called running time.</li>
<li><strong>Arrival Time:</strong> when a process enters in a ready state</li>
<li><strong>Finish Time:</strong> when process complete and exit from a system</li>
<li><strong>Multiprogramming:</strong> A number of programs which can be present in memory at the same time.
</li>
<li><strong>Jobs:</strong> It is a type of program without any kind of user interaction.</li>
<li><strong>User:</strong> It is a kind of program having user interaction.</li>
<li><strong>Process:</strong> It is the reference that is used for both job and user.</li>
<li><strong>CPU/IO burst cycle:</strong> Characterizes process execution, which alternates between CPU and I/O
activity. CPU times are shorter than the time of I/O.</li>
</p>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>Types of CPU Scheduling</h1>
<p>There is mainly two major types of CPU Scheduling which is listed below.There is sub-types of this algorithm also. we have discussed all algorithm in details below. </p>
<li>Preemptive Algorithm</li>
<li>Non Preemptive Algorithm</li>
<br>
<p><strong class="bold">Preemptive Scheduling</strong><br><br>
In Preemptive Scheduling, the tasks are mostly assigned with their priorities. Sometimes it is important to
run a task with a higher priority before another lower priority task, even if the lower priority task is
still running. The lower priority task holds for some time and resumes when the higher priority task
finishes its execution.<br><br>
<br>
<strong class="bold">Non-Preemptive Scheduling</strong><br><br>
In this type of scheduling method, the CPU has been allocated to a specific process. The process that keeps
the CPU busy will release the CPU either by switching context or terminating. It is the only method that can
be used for various hardware platforms. That’s because it doesn’t need special hardware (for example, a
timer) like preemptive scheduling.
</p>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>Types of CPU scheduling Algorithm</h1>
<p>There are mainly six types of process scheduling algorithm</p>
<!-- <lo> -->
<li>First Come First Serve (FCFS)</li>
<li>Shortest-Job-First (SJF) Scheduling</li>
<li>Shortest Remaining Time</li>
<li>Priority Scheduling</li>
<li>Round Robin Scheduling</li>
<li>Multilevel Queue Scheduling</li>
<br>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>1) First Come First Serve</h1>
<p>First Come First Serve is the full form of FCFS. It is the easiest and most simple CPU scheduling algorithm.
In this type of algorithm, the process which requests the CPU gets the CPU allocation first. This scheduling
method can be managed with a FIFO queue.<br><br>
As the process enters the ready queue, its PCB (Process Control Block) is linked with the tail of the queue.
So, when CPU becomes free, it should be assigned to the process at the beginning of the queue.</p>
<h4>
<li>Advantages</li>
</h4>
<p>1. It is simple and easy to understand.<br></p>
<h4>
<li>Disadvantages</li>
</h4>
<p>1. The process with less execution time suffer i.e. waiting time is often quite long.<br><br>
2. Favors CPU Bound process then I/O bound process.<br><br>
3. FCFS algorithm is particularly troublesome for time-sharing systems, where it is important that each user
get a share of the CPU at regular intervals.</p>
<button class="btn_1" onclick="gotoSimulator();">Go to Simulator</button>
<br>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>2) Shortest Remaining Time</h1>
<p>The full form of SRT is Shortest remaining time. It is also known as SJF preemptive scheduling. In this
method, the process will be allocated to the task, which is closest to its completion. This method prevents
a newer ready state process from holding the completion of an older process.<br></p>
<h4>
<li>Advantages</li>
</h4>
<p>1. The main advantage of the SRTF algorithm is that it makes the processing of the jobs faster than the SJF
algorithm, mentioned it’s overhead charges are not counted.</p>
<h4>
<li>Disadvantages</li>
</h4>
<p>1. In SRTF, the context switching is done a lot more times than in SJN due to more consumption of the CPU's
valuable time for processing. The consumed time of CPU then adds up to its processing time and which then
diminishes the advantage of fast processing of this algorithm.<br></p>
<button class="btn_1" onclick="gotoSimulator();">Go to Simulator</button>
<br>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>3) Priority Based Scheduling</h1>
<p>Priority scheduling is a method of scheduling processes based on priority. In this method, the scheduler
selects the tasks to work as per the priority.<br><br>
Priority scheduling also helps OS to involve priority assignments. The processes with higher priority should
be carried out first, whereas jobs with equal priorities are carried out on a round-robin or FCFS basis.
Priority can be decided based on memory requirements, time requirements, etc.<br><br>
</p>
<h4>
<li>Advantages</li>
</h4>
<p>1. This provides a good mechanism where the relative importance of each process maybe precisely defined.<br>
</p>
<h4>
<li>Disadvantages</li>
</h4>
<p>1. If high priority processes use up a lot of CPU time, lower priority processes may starve and be postponed
indefinitely.The situation where a process never gets scheduled to run is called starvation<br><br>
2. Another problem is deciding which process gets which priority level assigned to it..<br></p>
<button class="btn_1" onclick="gotoSimulator();">Go to Simulator</button>
<br>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>4) Round-Robin Scheduling</h1>
<p>Round robin is the oldest, simplest scheduling algorithm. The name of this algorithm comes from the
round-robin principle, where each person gets an equal share of something in turn. It is mostly used for
scheduling algorithms in multitasking. This algorithm method helps for starvation free execution of
processes.<br><br></p>
<h4>
<li>Advantages</li>
</h4>
<p>1. Every process gets an equal share of the CPU.<br><br>
2. RR is cyclic in nature, so there is no starvation.</p>
<h4>
<li>Disadvantages</li>
</h4>
<p>1. Setting the quantum too short, increases the overhead and lowers the CPU efficiency, but setting it too
long may cause poor response to short processes.<br><br>
2. Average waiting time under the RR policy is often long.<br>
</p>
<button class="btn_1" onclick="gotoSimulator();">Go to Simulator</button>
<br>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>5) Shortest Job First</h1>
<p>SJF is a full form of (Shortest job first) is a scheduling algorithm in which the process with the shortest
execution time should be selected for execution next. This scheduling method can be preemptive or
non-preemptive. It significantly reduces the average waiting time for other processes awaiting
execution.<br></p>
<h4>
<li>Advantages</li>
</h4>
<p>1. Shortest jobs are favored.<br><br>
2. It is provably optimal, in that it gives the minimum average waiting time for a given set of processes.
</p>
<h4>
<li>Disadvantages</li>
</h4>
<p>1. SJF may cause starvation, if shorter processes keep coming. This problem is solved by aging..<br><br>
2. It cannot be implemented at the level of short term CPU scheduling.<br></p>
<button class="btn_1" onclick="gotoSimulator();">Go to Simulator</button>
<br>
</section>
<section class="container_docs" data-aos="zoom-in-up">
<h1>6) Multiple-Level Queues Scheduling</h1>
<p>This algorithm separates the ready queue into various separate queues. In this method, processes are assigned
to a queue based on a specific property of the process, like the process priority, size of the memory,
etc.<br><br>
However, this is not an independent scheduling OS algorithm as it needs to use other types of algorithms in
order to schedule the jobs.<br><br></p>
<h4>
<li>Advantages</li>
</h4>
<p>1. Application of separate scheduling for various kind of processes is possible
.<br></p>
<h4>
<li>Disadvantages</li>
</h4>
<p>1. The lowest level process faces starvation problem.<br></p>
<button class="btn_1" onclick="gotoSimulator();">Go to Simulator</button>
<br>
</section>
<section class="footer">
<!-- <h4>About Us</h4>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Soluta pariatur eveniet eaque provident error velit totam quos. Corrupti sunt omnis<br> eligendi ut enim, sed magnamquo laboriosam, aspernatur nulla ipsum commodi itaque accusantium sapiente!</p> -->
<div class="icons">
<a href="https://www.facebook.com"><i class="fab fa-facebook"></i></a>
<a href="https://www.instagram.com/invites/contact/?i=17s1o7wfms500&utm_content=i08g8yn"><i class="fab fa-instagram"></i></a>
<a href="https://twitter.com/Krutarth12345?t=JASTMDZLzUB4VOR-OEd_kg&s=09"><i class="fab fa-twitter"></i></a>
<a href="https://www.linkedin.com/in/krutarth-patel-653065205 "><i class="fab fa-linkedin"></i></a>
</div>
<p>Made With <i class="far fa-heart"></i> by G5-team1</p>
<p> <i class="fa fa-copyright"></i> copyright 2022 || All rights reserved</p>
</section>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"></script>
<script>
var navLinks = document.getElementById("navLinks");
function showMenu() {
navLinks.style.right = "0";
}
function hideMenu() {
navLinks.style.right = "-200px";
}
function gotoSimulator(){
location.href = ("./backend/ganttcharts.html");
}
</script>
<!-- For the animation -->
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init({
offset: 200, // offset (in px) from the original trigger point
duration: 800
});
</script>
</body>
</html>