[OPERATING SYSTEMS] January 1, 2014
DISK SCHEDULING [Disk scheduling Theory Refer Unit – 5 ppt]
Suppose that a disk drive has 5000 cylinders numbered 0 to 4999. The drive is currently serving a
request at cylinder 143. The queue of the pending requests in FIFO order is
86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
What is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for
each of the following disk scheduling algorithms?
1.FCFS 2.SSTF 3.SCAN 4.C-SCAN 5.LOOK
1. FCFS
Head current position – 143
0 86 130 143 913 948 1022 1470 1509 1750 1774 4999
Next Accessed [FIFO] Number of Cylinder Traversed
86 143 - 86 57
1470 1470 - 86 1384
913 1470 - 913 557
1774 1774 - 913 861
948 1774 - 948 826
1509 1509 - 948 561
1022 1509 - 1022 487
1750 1750 - 1022 728
130 1750 - 130 1620
7081
Personal | Prepared By: CSK
1
[OPERATING SYSTEMS] January 1, 2014
2. SSTF [Shortest seek time first]
Head current position – 143
Ex:
1 2
[ 143 - 130 : 13 ] [ 130 – 86 : 44 ]
[ 913 – 143 : 770 ] [ 913 – 130 : 783 ]
13 is the shortest seek time 44 is the shortest seek time
0 86 130 143 913 948 1022 1470 1509 1750 1774 4999
Next Accessed [FIFO] Number of Cylinder Traversed
130 143 - 130 13
86 130 - 86 44
913 913 - 86 827
948 948 - 913 35
1022 1022 - 948 74
1470 1470 - 1022 448
1509 1509 - 1470 39
1750 1750 - 1509 241
1774 1774 - 1750 24
1745
Personal | Prepared By: CSK
2
[OPERATING SYSTEMS] January 1, 2014
3. SCAN
Head current position – 143
0 86 130 143 913 948 1022 1470 1509 1750 1774 4999
Next Accessed [FIFO] Number of Cylinder Traversed
130 143 - 130 13
86 130 - 86 44
0 86 - 0 86
913 913 - 0 913
948 948 - 913 35
1022 1022 - 948 74
1470 1470 - 1022 448
1509 1509 - 1470 39
1750 1750 - 1509 241
1774 1774 - 1750 24
1917
Personal | Prepared By: CSK
3
[OPERATING SYSTEMS] January 1, 2014
4. C - SCAN
Head current position – 143
0 86 130 143 913 948 1022 1470 1509 1750 1774 4999
Next Accessed [FIFO] Number of Cylinder Traversed
913 913 - 143 770
948 948 - 913 35
1022 1022 - 948 74
1470 1470 - 1022 488
1509 1509 - 1470 39
1750 1750 - 1509 241
1774 1774 - 1750 24
4999 4999 - 1774 3225
0 4999 - 0 4999
86 86 - 0 86
130 130 - 86 44
9985
Personal | Prepared By: CSK
4
[OPERATING SYSTEMS] January 1, 2014
5. LOOK
Head current position – 143
0 86 130 143 913 948 1022 1470 1509 1750 1774 4999
Next Accessed [FIFO] Number of Cylinder Traversed
913 913 - 143 770
948 948 - 913 35
1022 1022 - 948 74
1470 1470 - 1022 488
1509 1509 - 1470 39
1750 1750 - 1509 241
1774 1774 - 1750 24
86 1774 - 86 1688
130 130 - 86 44
3403
Personal | Prepared By: CSK
5