Transcript for:
FCFS Scheduling Algorithm

now let us discuss about fcfs discussion during algorithm we know the advantage of scheduling algorithms scheduling algorithms decides the order in which the adopts are to be executed fcfs means first come first server is scheduling algorithm so the job which has come first will be served first will be executed first let us discuss about fcfs discussion dueling algorithm with the help of an example so here totally 200 cylinders are given consider a disk queue with requests for io2 blocks on the cylinders so these are the cylinders 98 183 37 120 to 14 124 65 67 so those cylinders contains generally the cylinders contains data so now our Target is we have to access the cylinders in this order if the disk read write head is initially at the cine deck 53 so initially read write head is at 53 so from 53 cylinder onwards we have to move to the corresponding desired cylinder so find Total head movements so here our Target is we have to find how many total head movements are needed okay so totally 200 cylinders are given so we have 200 cylinders from 0 to 199 so initially we are at zero cylinder and the last cylinder is what 199 so totally 200 cylinders are given and initially read write here is at 53 cylinder so let this is 53 cylinder next we have to move to the cylinder 98 from 53 so let 98 is at this location so we have to read that cylinder we have to read the content and that cylinder so 53 to 98 so next we have to find out total head movements so simply we have to subtract 53 from the 98. so 98 minus 53 so this is the first operation so next one after 98 we have to access 183 so from 98 to 183 so let 183 is at this location 183 okay so 98 to 183 so here what is the bigger value 183 is the bigger value so we have to subtract 98 from the 183 suppose if we subtract 183 from the 98 then it will gives what negative value but here the total head movements are must be a positive value so we have to subtract minimum value from the maximum value okay so 183 minus 98 183 minus 98 so next after 183 we have to access 37 so let 37 cylinderies at this location so 183 to 37 okay 37 so what is the operation subtract 37 from 183 183 . next to place next what is the next cylinder 1.2 so next again we have to move to 122. 122 so let 1202 cylinder is at this position so we have to subtract now we have to subtract uh 37 from the 122 so 122 minus 122 minus 37 Plus plus next after 122 we have 14 cylinder so let four let me have 14 at this location next again we have to move from it's 14 to 122. 14 to 122. so next subtract 14 from 122 okay 14 from 122 next place Plus for space constraints I am arising this portion next to 14 to 124 14 to 124 let 124 is at this location next to from 14 to 124 124 so subtract 14 from 124 next after 124 we have 65 so let 65 is at this location so 124 to 65. so 124 minus 65 okay next after 65 we have 67 let's 67 is at this location so simply do the subtraction so 67 minus 65 okay if You observe here initially read write head is at the location 53 so 98 minus 53 next 183 minus 98 next 183 minus 37 next to 122 minus 37 next to 122 minus 14 122 minus 14 next to 124 minus 14. okay 122 minus 14 124 minus 14 next 124 minus 65 67 minus 65 so if you do the subtractions and editions then we will get 640. so totally we need a head movement of 640 cylinders so this is about fcfs description algorithm