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.

Tutorial on CPU Scheduling Algorithms in Operating System

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
  • Comparison between various CPU Scheduling Algorithms
    • Exercise

Similar Reads

What is a process?

In computing, a process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently....

How is process memory used for efficient operation?

The process memory is divided into four sections for efficient operation:...

What is Process Scheduling?

Process Scheduling is the process of the process manager handling the removal of an active process from the CPU and selecting another process based on a specific strategy....

Why do we need to schedule processes?

Scheduling is important in many different computer environments. One of the most important areas is scheduling which programs will work on the CPU. This task is handled by the Operating System (OS) of the computer and there are many different ways in which we can choose to configure programs. Process Scheduling allows the OS to allocate CPU time for each process. Another important reason to use a process scheduling system is that it keeps the CPU busy at all times. This allows you to get less response time for programs.  Considering that there may be hundreds of programs that need to work, the OS must launch the program, stop it, switch to another program, etc. The way the OS configures the system to run another in the CPU is called “context switching”. If the OS keeps context-switching programs in and out of the provided CPUs, it can give the user a tricky idea that he or she can run any programs he or she wants to run, all at once. So now that we know we can run 1 program at a given CPU, and we know we can change the operating system and remove another one using the context switch, how do we choose which programs we need. run, and with what program? That’s where scheduling comes in! First, you determine the metrics, saying something like “the amount of time until the end”. We will define this metric as “the time interval between which a function enters the system until it is completed”. Second, you decide on a metrics that reduces metrics. We want our tasks to end as soon as possible....

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....

What are the different terminologies to take care of in any CPU Scheduling algorithm?

Arrival Time: Time at which the process arrives in the ready queue. Completion Time: Time at which process completes its execution. Burst Time: Time required by a process for CPU execution. Turn Around Time: Time Difference between completion time and arrival time....

Things to take care while designing a CPU Scheduling algorithm?

Different CPU Scheduling algorithms have different structures and the choice of a particular algorithm depends on a variety of factors. Many conditions have been raised to compare CPU scheduling algorithms....

What are the different types of CPU Scheduling Algorithms?

There are mainly two types of scheduling methods:...

Comparison between various CPU Scheduling algorithms

Here is a brief comparison between different CPU scheduling algorithms:...