Disk Scheduling (Scan - Algorithm)

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

DISK SCHEDULING

(SCAN - ALGORITHM)

By - Sachi Meshram(4CE44)
Vaishnavi Pannase(4CE72)
Disk Scheduling
➢ Disk scheduling is done by operating
systems to schedule I/O requests arriving
for the disk. Disk scheduling is also known
as I/O scheduling.
➢ The access time has two major
components.
➢ The Seek Time is the time for the disk arm
to move the heads to the cylinder
containing the desired sector.
➢ The Rotational Latency is the additional
time for the disk to rotate the desired sector
to disk head.
There are various types of disk scheduling
algorithem . They are :-
1.FCFS
2.SSTF
3.SCAN
4.C-SCAN
5.LOOK
6.C-LOOK
SCAN ALGORITHM

★ It is also known as ELEVATOR ALGORITHM .


★ In this algorithm , the disk arm moves into a particular
direction till the end , satisfying all the requests coming
in its path , and then it turns backward and moves in
the reverse direction satisfying requests coming in its
path.
Seek Time : Seek time is the time required to move the disk arm
to the required track.

Rotational Time : Time taken for one full rotation (360 degree).

Rotational Latency : The amount of time taken by the disk to


rotate the track when the read/write headcome to exact sector.

Transfer Time: Transfer time is the time to transfer the data. It


depends on the rotating speed of the disk and number of bytes to
be transferred.
Example : A disk contains 200 tracks ( 0 - 199 ) request queue contains track no.
82 , 170 , 43 , 140 , 24 , 16 , 190 respectively. Current position of R\W head = 50.
Calculate total number of tracks movement by R\W head using SCAN?
If R\W head takes 1ns to move from one track to another then total time taken will
be?
Total no. of track movement by R\W head using SCAN = (199 - 50) + (199 - 16)
=332

Or

Total no. of track movement by R\W head using SCAN = (82-50) + (140-82) + (170-140) +
(190-170) +
(199-190) + (199-43) + (43-24) + (24-16)
= 332

Total time taken = 332 ns


= 332 * 10^-9 s
ADVANTAGES :
➔ This algorithm is simple and easy to understand.
➔ SCAN algorithm has no starvation.
➔ This algorithm is better than FCFS scheduling algorithm.

DISADVANTAGES :
➔ More complex algorithm to understand.
➔ It cause long waiting time for the cylinders just visited by the head.
➔ It causes the head to move till the end of the disk in this way the requests arriving
ahead of the arm position would get immediate service but some other requests
that arrive behind the arm position will have to wait for the request to complete.

You might also like