FCFSSchedulingFirst-come, first-served (FCFS)9818337122143753656798122124183140199V12465Platter67RequestQueue16
FCFS Scheduling • First-come, first-served (FCFS) 16 Platter 183 98 122 37 124 14 67 65 Platter Request Queue 0 199 14 37 53 65 67 98 122 124 183 98 183 37 122 14 124 65 67
FCFSScheduling? Scheduling diagramTotal headmovement(640cylinders)queue=98,183,37,122,14,124,65,67head startsat5301437536567183199981221241wildswingisverycommonE.g.: 122 to 14, then to 124Howto reducetheheadmovement?文Handle nearby requestsfirst17
FCFS Scheduling • Scheduling diagram 17 Total head movement (640 cylinders) Wild swing is very common E.g.: 122 to 14, then to 124 How to reduce the head movement? Handle nearby requests first
SSTFScheduling? Shortest seek time first (SSTF)- Choose the request with the least seek time Choose the request closest to the current head position18
SSTF Scheduling • Shortest seek time first (SSTF) – Choose the request with the least seek time – Choose the request closest to the current head position 18
SSTFScheduling Shortest seek time first (SSTF)9818337122143753656798122 12418314019912465Platter67RequestQueue19
SSTF Scheduling • Shortest seek time first (SSTF) 19 Platter 183 98 122 37 124 14 67 65 Platter Request Queue 0 199 14 37 53 65 67 98 122 124 183 98 183 37 122 14 124 65 67
SSTF Scheduling? Scheduling diagramTotalheadmovement:236Cylinders(itis640forFCFS)queue=98,183,37,122,14,124,65,67headstartsat53Essentiallyaformof SJF3798183199014536567122124schedulingIt isnot optimalThesequenceof53-37-14-65..could reduce theheadmovementto 208Itmaycausestarvation20
SSTF Scheduling • Scheduling diagram 20 Total head movement: 236 cylinders (it is 640 for FCFS) Essentially a form of SJF scheduling It is not optimal The sequence of 53-37-14-65. could reduce the head movement to 208 It may cause starvation