The Wayback Machine - https://web.archive.org/web/20240711014017/https://www.geeksforgeeks.org/cpu-scheduling-criteria/
Open In App

CPU Scheduling Criteria

Last Updated : 12 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

CPU scheduling is essential for the system’s performance and ensures that processes are executed correctly and on time. Different CPU scheduling algorithms have other properties and the choice of a particular algorithm depends on various factors. Many criteria have been suggested for comparing CPU scheduling algorithms.

What is CPU scheduling?

CPU Scheduling is a process that allows one process to use the CPU while another process is delayed due to unavailability of any resources such as I / O etc, thus making full use of the CPU. In short, CPU scheduling decides the order and priority of the processes to run and allocates the CPU time based on various parameters such as CPU usage, throughput, turnaround, waiting time, and response time. The purpose of CPU Scheduling is to make the system more efficient, faster, and fairer.

Criteria of CPU Scheduling

CPU Scheduling has several criteria. Some of them are mentioned below.

1. CPU utilization

The main objective of any CPU scheduling algorithm is to keep the CPU as busy as possible. Theoretically, CPU utilization can range from 0 to 100 but in a real-time system, it varies from 40 to 90 percent depending on the load upon the system. 

2. Throughput

A measure of the work done by the CPU is the number of processes being executed and completed per unit of time. This is called throughput. The throughput may vary depending on the length or duration of the processes. 

CPU Scheduling Criteria

CPU Scheduling Criteria

3. Turnaround Time

For a particular process, an important criterion is how long it takes to execute that process. The time elapsed from the time of submission of a process to the time of completion is known as the turnaround time. Turn-around time is the sum of times spent waiting to get into memory, waiting in the ready queue, executing in CPU, and waiting for I/O. 

Turn Around Time = Completion Time – Arrival Time.

4. Waiting Time

A scheduling algorithm does not affect the time required to complete the process once it starts execution. It only affects the waiting time of a process i.e. time spent by a process waiting in the ready queue. 

Waiting Time = Turnaround Time – Burst Time.

5. Response Time

In an interactive system, turn-around time is not the best criterion. A process may produce some output fairly early and continue computing new results while previous results are being output to the user. Thus another criterion is the time taken from submission of the process of the request until the first response is produced. This measure is called response time. 

Response Time = CPU Allocation Time(when the CPU was allocated for the first) – Arrival Time

6. Completion Time

The completion time is the time when the process stops executing,  which means that the process has completed its burst time and is completely executed.

7. Priority

If the operating system assigns priorities to processes, the scheduling mechanism should favor the higher-priority processes.

8. Predictability

A given process always should run in about the same amount of time under a similar system load.

Importance of Selecting the Right CPU Scheduling Algorithm for Specific Situations

It is important to choose the correct CPU scheduling algorithm because different algorithms have different priorities for different CPU scheduling criteria.Different algorithms have different strengths and weaknesses. Choosing the wrong CPU scheduling algorithm in a given situation can result in suboptimal performance of the system.

Example: Here are some examples of CPU scheduling algorithms that work well in different situations.

Round Robin scheduling algorithm works well in a time-sharing system where tasks have to be completed in a short period of time. SJF scheduling algorithm works best in a batch processing system where shorter jobs have to be completed first in order to increase throughput.Priority scheduling algorithm works better in a real-time system where certain tasks have to be prioritized so that they can be completed in a timely manner.

Factors Influencing CPU Scheduling Algorithms

There are many factors that influence the choice of CPU scheduling algorithm. Some of them are listed below.

  • The number of processes.
  • The processing time required.
  • The urgency of tasks.
  • The system requirements.

Selecting the correct algorithm will ensure that the system will use system resources efficiently, increase productivity, and improve user satisfaction.

CPU Scheduling Algorithms

There are several CPU Scheduling Algorithms, that are listed below.

Conclusion

In Conclusion, CPU scheduling criteria play an important role in improving system performance. CPU scheduling techniques encourage efficient use of system resource and effective task processing by analysing and prioritising criteria such as CPU Utilization, Throughput, Turnaround Time, Waiting Time, and Response Time. Selecting the appropriate algorithm for a given situation is crucial for increasing system efficiency and production.

Question for Practice

Which of the following process scheduling algorithm may lead to starvation?

(A) FIFO

(B) Round Robin

(C) Shortest Job Next

(D) None of the above

Correct option is (C)
Explanation: Shortest job next may lead to process starvation for processes which will require 
a long time to complete if short processes are continually added.

Frequently Asked Question on CPU Scheduling Criteria – FAQs

How does CPU utilization affect scheduling algorithms?

CPU utilization indicates the efficiency of utilizing the CPU’s processing power. Scheduling algorithms aim to keep the CPU as busy as possible to achieve high utilization. However, excessively high CPU utilization can lead to poor system responsiveness and potential resource contention.

What is throughput in the context of scheduling algorithms?

Throughput refers to the number of processes that are completed and leave the system within a given time frame. Scheduling algorithms that maximize throughput often prioritize short processes or those that require minimal CPU time, allowing more processes to be completed in a given period.

Why is turnaround time an important criterion for scheduling algorithms?

Turnaround time measures the overall time a process takes to complete, from submission to termination. Lower turnaround time indicates efficient process execution. Scheduling algorithms that minimize turnaround time generally prioritize processes with shorter burst times or high priority.

What trade-offs are involved in selecting a scheduling algorithm?

Some trade-off may include that the improving in throughput may lead to increment in waiting time.



Previous Article
Next Article

Similar Reads

Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read
Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read
Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling
Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling is like Multilevel Queue(MLQ) Scheduling but in this process can move between the queues. And thus, much more efficient than multilevel queue scheduling. Characteristics of Multilevel Feedback Queue Scheduling: In a multilevel queue-scheduling algorithm, processes are permanently assigned t
5 min read
Difference Between User-CPU-Time and System-CPU-Time in UNIX
Unix systems have a time utility that allows a user to see where their application took significant time to process. The syntax of this utility is as follows: time <command-to-be-timed>Its result generally has three categories as follows: real <time> user <time> sys <time>User CPU time and system CPU time are both measures o
3 min read
Program for FCFS CPU Scheduling | Set 1
Given n processes with their burst times, the task is to find average waiting time and average turn around time using FCFS scheduling algorithm. First in, first out (FIFO), also known as first come, first served (FCFS), is the simplest scheduling algorithm. FIFO simply queues processes in the order that they arrive in the ready queue. In this, the
15+ min read
Operating Systems | CPU Scheduling | Question 1
Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is: (A) 13 units (B) 1
1 min read
Operating Systems | CPU Scheduling | Question 2
Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units, respectively. Each process spends the first 20% of execution time doing I/O, the next 70% of time doing computation, and the last 10% of time doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm a
2 min read
Operating Systems | CPU Scheduling | Question 3
Consider three CPU-intensive processes, which require 10, 20 and 30 time units and arrive at times 0, 2 and 6, respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end. (A) 1 (B) 2 (C) 3 (D) 4 Answer: (B)
1 min read
Operating Systems | CPU Scheduling | Question 4
Which of the following process scheduling algorithm may lead to starvation (A) FIFO (B) Round Robin (C) Shortest Job Next (D) None of the above Answer: (C) Explanation: Shortest job next may lead to process starvation for processes which will require a long time to complete if short processes are continually added.Quiz of this Question
1 min read
Operating Systems | CPU Scheduling | Question 5
If the quantum time of round robin algorithm is very large, then it is equivalent to: (A) First in first out (B) Shortest Job Next (C) Lottery scheduling (D) None of the above Answer: (A) Explanation: If time quantum is very large, then scheduling happens according to FCFS.Quiz of this Question
1 min read