I would like to know what impacts does a scheduling algorithm say Round Robin of FIFO have on a Operating system. I understand the a scheduling algorithm has the processes run in burst then switch between one another. But what does this mean for an OS. All i can figure out is that the OS has to keep track of which process is running, see if its done/completed its operation, chose/switch to another process and run it for a given time. Am I missing the obvious here? It does not really seam to me that a scheduling algorithm really affect the OS per say but the CPU hardware.
migrated from cstheory.stackexchange.com Nov 1 '12 at 20:15
It seems that the missing piece here is that the switching does not only occur when a process completes. The switch will occur when either 1) the process completes, or 2) when the process explicitly yields its remaining run time slice (whatever it has not used of its time quantum), or 3) when the OS pre-emptively interrupts the process due to that process having been running for all of its assigned time quantum.
The OS is responsible for allowing all the processes that need to get 'OnProc' (on processor) some time to actually be running on a processor. The scheduling algorithm is what determines how "fair" the choice of which process next gets to run on a processor is. Note that technically all of the above really should have the word 'process' replaced with the word 'thread' (of which a single process may have many, and also not all threads necessarily have a process associated with them)
As for what the impact is on the OS - that is a question that needs more definition. I can say that other than the scheduler threads and timers and interrupts, generally all threads are subject to the scheduler so the OS will be impacted by the choice of algorithm.