What is the need for CPU scheduling algorithm?
CPU scheduling is the process of deciding which process will own the CPU to use while another process is suspended. The main function of the CPU scheduling is to ensure that whenever the CPU remains idle, the OS has at least selected one of the processes available in the ready-to-use line.
In Multiprogramming, if the long-term scheduler selects multiple I / O binding processes then most of the time, the CPU remains an idle. The function of an effective program is to improve resource utilization.
If most operating systems change their status from performance to waiting then there may always be a chance of failure in the system. So in order to minimize this excess, the OS needs to schedule tasks in order to make full use of the CPU and avoid the possibility of deadlock.
Objectives of Process Scheduling Algorithm:
- Utilization of CPU at maximum level. Keep CPU as busy as possible.
- Allocation of CPU should be fair.
- Throughput should be Maximum. i.e. Number of processes that complete their execution per time unit should be maximized.
- Minimum turnaround time, i.e. time taken by a process to finish execution should be the least.
- There should be a minimum waiting time and the process should not starve in the ready queue.
- Minimum response time. It means that the time when a process produces the first response should be as less as possible.
CPU Scheduling in Operating Systems
Scheduling of processes/work is done to finish the work on time. CPU Scheduling is a process that allows one process to use the CPU while another process is delayed (in standby) due to unavailability of any resources such as I / O etc, thus making full use of the CPU. The purpose of CPU Scheduling is to make the system more efficient, faster, and fairer.
Whenever the CPU becomes idle, the operating system must select one of the processes in the line ready for launch. The selection process is done by a temporary (CPU) scheduler. The Scheduler selects between memory processes ready to launch and assigns the CPU to one of them.
Table of Contents
- What is a Process?
- How is Process Memory used for efficient operation?
- What is Process Scheduling?
- Why do we need to schedule processes?
- What is the need for CPU Scheduling Algorithm?
- Objectives of Process Scheduling Algorithm
- What are the different terminologies?
- Things to take care while designing CPU Scheduling Algorithm
- What are different types of CPU Scheduling Algorithms?
- 1) First Come First Serve (FCFS)
- Characteristics of FCFS
- Advantages of FCFS
- Disadvantages of FCFS
- 2) Shortest Job First (SJF)
- Characteristics of SJF
- Advantages of SJF
- Disadvantages of SJF
- 3) Longest Job First (LJF)
- Characteristics of LJF
- Advantages of LJF
- Disadvantages of LJF
- 4) Priority Scheduling
- Characteristics of Priority Scheduling
- Advantages of Priority Scheduling
- Disadvantages of Priority Scheduling
- 5) Round Robin
- Characteristics of Round Robin
- Advantages of Round Robin
- 6) Shortest Remaining Time First (SRTF)
- Characteristics of SRTF
- Advantages of SRTF
- Disadvantages of SRTF
- 7) Longest Remaining Time First (LRTF)
- Characteristics of LRTF
- Advanatges of LRTF
- Disadvantages of LRTF
- 8) Highest Response Ratio Next (HRRN)
- Characteristics of HRRN
- Advantages of HRRN
- Disadvantages of HRRN
- 9) Multiple Queue Scheduling
- Advantages of multilevel queue scheduling
- Disadvantages of multilevel queue scheduling
- 10) Multilevel Feedback Queue Scheduling (MLFQ)
- Characteristics of MLFQ
- Advantages of MLFQ
- Disadvantages of MLFQ
- 1) First Come First Serve (FCFS)
- Comparison between various CPU Scheduling Algorithms
- Exercise