CPU Scheduling, involves many different scheduling algorithms which have their Advantages and Disadvantages.
- It is simple and easy to understand.
- The process with less execution time suffer i.e. waiting time is often quite long.
- Favors CPU Bound process then I/O bound process.
- Here, first process will get the CPU first, other processes can get CPU only after the current process has finished it’s execution. Now, suppose the first process has large burst time, and other processes have less burst time, then the processes will have to wait more unnecessarily, this will result in more average waiting time, i.e., Convey effect.
- This effect results in lower CPU and device utilization.
- FCFS algorithm is particularly troublesome for time-sharing systems, where it is important that each user get a share of the CPU at regular intervals.
- Shortest jobs are favored.
- It is provably optimal, in that it gives the minimum average waiting time for a given set of processes.
- SJF may cause starvation, if shorter processes keep coming. This problem is solved by aging.
- It cannot be implemented at the level of short term CPU scheduling.
3. Round Robin (RR):
- Every process gets an equal share of the CPU.
- RR is cyclic in nature, so there is no starvation.
- Setting the quantum too short, increases the overhead and lowers the CPU efficiency, but setting it too long may cause poor response to short processes.
- Average waiting time under the RR policy is often long.
- This provides a good mechanism where the relative importance of each process maybe precisely defined.
- If high priority processes use up a lot of CPU time, lower priority processes may starve and be postponed indefinitely.The situation where a process never gets scheduled to run is called starvation.
- Another problem is deciding which process gets which priority level assigned to it.
Application of separate scheduling for various kind of processes is possible.
- System Process – FCFS
- Interactive Process – SJF
- Batch Process – RR
- Student Process – PB
- Application of separate scheduling for various kind of processes is possible.
- The lowest level process faces starvation problem.
- Low scheduling overhead.
- Allows aging, thus no starvation.
- It’s not flexible.
- It also requires some means of selecting values for all the parameters to define the best scheduler, thus it is also the most complex.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Advantages and Disadvantages of various Disk scheduling algorithms
- Advantages and Disadvantages of various Page Replacement algorithms
- Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
- Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
- Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling
- Advantages and Disadvantages of working in a Startup
- Advantages and Disadvantages of Subnetting
- Advantages and Disadvantages of SQL
- Advantages and Disadvantages of Using Stored Procedures - SQL
- Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
- Difference between Preemptive and Non-preemptive CPU scheduling algorithms
- Difference between SJF and LJF CPU scheduling algorithms
- Difference between FCFS and SJF CPU scheduling algorithms
- Difference between SJF and SRJF CPU scheduling algorithms
- Difference between SRJF and LRJF CPU scheduling algorithms
- Difference between First Come First Served (FCFS) and Longest Job First (LJF) CPU scheduling algorithms
- Difference between EDF and LST CPU scheduling algorithms
- Difference between Multilevel Queue (MLQ) and Multi Level Feedback Queue (MLFQ) CPU scheduling algorithms
- Difference between LJF and LRJF CPU scheduling algorithms
- Difference between Turn Around Time (TAT) and Waiting Time (WT) in CPU Scheduling
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.