-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsstf.html
443 lines (390 loc) · 24.8 KB
/
sstf.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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<!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">
<title>OS Virtual Lab</title>
<link rel="stylesheet" href="css/bootstrap.css" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/animate.css" type="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0"
crossorigin="anonymous"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="shortcut icon" type="image/png" href="images/website_logo1.png">
</head>
<body>
<nav class="navbar sticky-top navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="diskscheduling_index.html">
<img id="logo" src="images/website_logo1.png" alt="logo">
<div class="hover-border">Disk Scheduling</div>
</a>
<div class="divider"></div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.html">
<div class="hover-border">Home</div>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
Algorithms
</a>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="pagereplacement_index.html">Page Replacement</a></li>
<li><a class="dropdown-item" href="diskscheduling_index.html">Disk Scheduling</a></li>
<li><a class="dropdown-item" href="#">CPU Scheduling</a></li>
<li><a class="dropdown-item" href="#">Concurrency</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="compare.html"><span class="hover-border">Compare</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html"><span class="hover-border">About Developers</span></a>
</li>
</ul>
<div class="d-flex">
<div class="dropdown">
<input id="search-input" class="form-control me-2 dropdown-toggle" data-bs-toggle="dropdown"
aria-expanded="false" placeholder="Type to search...">
<ul id="suggestions" class="dropdown-menu dropdown-menu-dark" aria-labelledby="search-button">
</ul>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
class="bi bi-search" viewBox="0 0 16 16" style="position: absolute; right: 15px;">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
</nav>
<div class="block">
<div class="overlay"></div>
<div class="heading">
<h1 class="animate__animated animate__slideInUp" data-aos="fade-in" style="text-align: center;">SSTF
</h1>
</div>
<div class="arrow-box">
<img src="images/down_arrow.png" alt="Downward Arrow">
</div>
</div>
<div class="mid-block">
<div class="mid-heading-wrapper">
<div class="mid-heading">
<h1 class="hover-border">About</h1>
</div>
</div>
<div class="mid-cards">
<div class="card text-white bg-dark mb-3" style="max-width: 24rem;">
<div class="card-header" style="font-size: 2rem;">SSTF</div>
<div class="card-body" style="overflow-y: scroll;">
<p class="card-text">In SSTF, requests having shortest seek time are executed first. So, the seek
time of every request is calculated in advance in the queue and then they are scheduled
according to their calculated seek time. As a result, the request near the disk arm will get
executed first. SSTF is certainly an improvement over FCFS as it decreases the average response
time and increases the throughput of system.</p><br>
<div class="card-header bg-dark" style="font-size: 1.5rem; padding: 0; border: 0;">Advantages</div>
<p class="card-text">
<ol>
<li>
In SSTF disk scheduling, the average response time is decreased.
</li><br>
<li>
Increased throughput.
</li><br>
</ol>
</p>
<div class="card-header bg-dark" style="font-size: 1.5rem; padding: 0; border: 0;">Disadvantages
</div>
<p class="card-text">
<ol>
<li>
In SSTF, there may be a chance of starvation.
</li><br>
<li>
SSTF is not an optimal algorithm.
</li><br>
<li>
There are chances of overhead in SSTF disk scheduling because, in this algorithm, we have to
calculate the seek time in advanced.
</li><br>
<li>
The speed of this algorithm can be decreased because direction could be switched frequently.
</li><br>
</ol>
</p>
</div>
</div>
<div class="card text-white bg-dark mb-3" style="max-width: 24rem;">
<div class="card-header" style="font-size: 2rem;">Algorithm</div>
<div class="card-body" style="overflow-y: scroll;">
<p class="card-text">
<ol>
<li> Let Request array represents an array storing indexes of tracks that have been requested.
‘head’ is the position of disk head.
</li><br>
<li>
Find the positive distance of all tracks in the request array from head.
</li><br>
<li>
Find a track from requested array which has not been accessed/serviced yet and has minimum
distance from head.
</li><br>
<li>
Increment the total seek count with this distance.
</li><br>
<li>
Currently serviced track position now becomes the new head position.
</li><br>
<li>
Go to step 2 until all tracks in request array have not been serviced.
</li><br>
</ol>
</p>
</div>
</div>
</div>
</div>
<div class="last-block">
<div class="mid-heading-wrapper">
<div class="mid-heading">
<h1 class="hover-border">Implementation</h1>
</div>
</div>
<div id="alert-wrapper"></div>
<div class="running-algo">
<form>
<div id="controls">
<div class="mb-3">
<label for="formGroupExampleInput" class="form-label">Number Of Requests</label>
<input type="number" class="form-control glowing-border" id="requests">
</div>
<div class="mb-3">
<label for="formGroupExampleInput" class="form-label">Total Tracks</label>
<input type="number" class="form-control" id="max-track" placeholder="Maximum track number">
</div>
<div class="mb-3">
<label for="formGroupExampleInput2" class="form-label">Head Position</label>
<input type="number" class="form-control" id="head" data-bs-toggle="popover"
data-bs-trigger="hover" title="Important!"
data-bs-content="The value of head position should not lie outside the range of track numbers.">
</div>
<div class="mb-3">
<label for="formGroupExampleInput2" class="form-label">Tracks</label>
<input type="text" class="form-control" id="tracks" placeholder="Track requests"
data-bs-toggle="popover" data-bs-trigger="hover" title="Important!"
data-bs-content="Make sure that the values of the tracks are either space separated or comma separated. There should not be any comma before the first track value and after the last track value. Any track request should not exceed the maximum possible track number.">
</div>
<div class="algo-buttons">
<input id="reset-button" type="reset" class="btn btn-dark form-control last_button"
style="margin: 10px;">
<button id="run" type="button" class="btn btn-dark last_button disabled"
data-bs-toggle="popover" data-bs-trigger="hover" title="Warning!"
data-bs-content="None of the fields above should be empty. They should not contain any alphabetic or special character!"
style="margin: 10px;">Run</button>
</div>
</div>
</form>
<div class='chart-wrapper'>
<div id="image" class="chart-display">
<div class="show-element" id="chart-image">
CHART WILL APPEAR HERE
</div>
<div id="chart-container" class="show-element">
<div class="chartres">
<canvas id="chart"></canvas>
</div>
<div id="seekShow">
<div id="seek" style="width: 80%; height: 10%; text-align: center;" data-bs-toggle="popover"
data-bs-placement="left" data-bs-trigger="click" title="Important!"
data-bs-content="Considering the successive track seek time as 1ms.">
<h4 id="temp"> </h4>
<h4 id="temp1"> </h4>
</div>
<div id="download-buttons">
<div id="dImageIcon"></div>
<div id="dPDFIcon"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<br>
<!-- Footer -->
<div id="foooter">
<div class="footer-dark">
<footer>
<div id="footer-container" class="footercontainer">
<div class="footerflex-1">
<div class="footerrow">
<!-- First Panel -->
<div class="footerpanel-group" id="accordion">
<div class="panel panel-default" id="footerpanel">
<div class="footerpanel-heading">
<h4 class="footerpanel-title accordion-button" data-bs-toggle="collapse"
data-bs-target="#collapseOne,#collapseTwo,#collapseThree,#collapseFour,#collapseFive"
aria-expanded="false" aria-controls="collapseOne">OS Virtual Lab
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse" aria-labelledby="headingOne"
data-bs-parent="#accordion">
<div class="footercontent">
<ul style="list-style-type: none;">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="pagereplacement_index.html">Page Replacement</a></li>
<li><a href="diskscheduling_index.html">Disk Scheduling</a></li>
<li><a href="#CpuScheduling">CPU Scheduling</a></li>
<li><a href="#Concurrency">Concurrency</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Second Panel -->
<div class="footerpanel-group" id="accordion">
<div class="panel panel-default" id="footerpanel">
<div class="footerpanel-heading">
<h4 class="footerpanel-title accordion-button" data-bs-toggle="collapse"
data-bs-target="#collapseOne,#collapseTwo,#collapseThree,#collapseFour,#collapseFive"
aria-expanded="false" aria-controls="collapseOne">Page Replacement
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" aria-labelledby="headingOne"
data-bs-parent="#accordion">
<div class="footercontent">
<ul style="list-style-type: none;">
<li><a href="fifo.html">FIFO</a></li>
<li><a href="lifo.html">LIFO</a></li>
<li><a href="lru.html">LRU</a></li>
<li><a href="optimal.html">OPTIMAL</a></li>
<li><a href="random.html">RANDOM</a></li>
<li><a href="belady.html">BELADY</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Third Panel -->
<div class="footerpanel-group" id="accordion">
<div class="panel panel-default" id="footerpanel">
<div class="footerpanel-heading">
<h4 class="footerpanel-title accordion-button" data-bs-toggle="collapse"
data-bs-target="#collapseOne,#collapseTwo,#collapseThree,#collapseFour,#collapseFive"
aria-expanded="false" aria-controls="collapseOne">Disc Scheduling
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" aria-labelledby="headingOne"
data-bs-parent="#accordion">
<div class="footercontent">
<ul style="list-style-type: none;">
<li><a href="fcfs.html">FCFS</a></li>
<li><a href="sstf.html">SSTF</a></li>
<li><a href="scan.html">SCAN</a></li>
<li><a href="cscan.html">C-SCAN</a></li>
<li><a href="look.html">LOOK</a></li>
<li><a href="clook.html">C-LOOK</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Fourth Panel -->
<div class="footerpanel-group" id="accordion">
<div class="panel panel-default" id="footerpanel">
<div class="footerpanel-heading">
<h4 class="footerpanel-title accordion-button" data-bs-toggle="collapse"
data-bs-target="#collapseOne,#collapseTwo,#collapseThree,#collapseFour,#collapseFive"
aria-expanded="false" aria-controls="collapseOne">CPU Scheduling
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse" aria-labelledby="headingOne"
data-bs-parent="#accordion">
<div class="footercontent">
<ul style="list-style-type: none;">
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Fifth Panel -->
<div class="footerpanel-group" id="accordion">
<div class="panel panel-default" id="footerpanel">
<div class="footerpanel-heading">
<h4 class="footerpanel-title accordion-button" data-bs-toggle="collapse"
data-bs-target="#collapseOne,#collapseTwo,#collapseThree,#collapseFour,#collapseFive"
aria-expanded="false" aria-controls="collapseOne">Concurrency
</h4>
</div>
<div id="collapseFive" class="panel-collapse collapse" aria-labelledby="headingOne"
data-bs-parent="#accordion">
<div class="footercontent">
<ul style="list-style-type: none;">
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div
style="padding-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center;">
<span style="margin: 20px;">
<a href="https://github.com/HansalShah007/osvirtuallab" target="_blank"
style="margin: 10px;"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="35"
fill="white" class="bi bi-github" viewBox="0 0 16 16">
<path
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z" />
</svg></a>
<a href="https://www.youtube.com/watch?v=JBle9-W1g8M&t=369s" target="_blank" style="margin: 10px;"><svg xmlns="http://www.w3.org/2000/svg"
width="35" height="35" fill="white" class="bi bi-youtube" viewBox="0 0 16 16">
<path
d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z" />
</svg></a>
</span>
<span style="font-size: 2.5rem; margin: 20px 0px 20px 0px; ">|</span>
<span class="copyright"
style="margin: 20px; display: flex; justify-content: center; align-items: center; padding: 0px;">OS
Project © Team 15</span>
</div>
</div>
</footer>
</div>
</div>
<script src="js/Chart.min.js"></script>
<script src="js/search.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.debug.js"></script>
<script src="js/sstf.js"></script>
</body>
</html>