Goseeko blog

What is CPU Scheduling?

by Bhumika

CPU Scheduling is the process of determining which process will have exclusive use of the CPU while another is paused. The basic goal of CPU scheduling is to ensure that whenever the CPU is idle, the OS chooses at least one of the programs in the ready queue to run. The CPU scheduler will be in charge of the selecting process. It chooses from among the processes in memory that are ready to run.

Types

1. Preemptive scheduling

Tasks are generally assigned with their priorities in Preemptive Scheduling. Even if the lower priority activity is still running, it is sometimes necessary to run a higher priority task before a lower priority task.

2. Non-preemptive scheduling

The CPU has been assigned to a certain process in this scheduling mechanism. The process that keeps the CPU occupied will either switch context or terminate to relieve the CPU. It’s the only method that works across a variety of hardware platforms. That’s because, unlike preemptive scheduling, it doesn’t require any particular hardware (such as a timer).

Types of CPU scheduling Algorithm

  • First Come First Serve (FCFS)
  • Shortest-Job-First (SJF) Scheduling
  • Shortest Remaining Time
  • Priority Scheduling
  • Round Robin Scheduling

CPU Scheduling Criteria

The following are the objectives of a CPU scheduling algorithm:

CPU utilization – CPU utilization is the primary task that the operating system must perform to keep the CPU as active as feasible. Moreover, It might be anywhere between 0% and 100%.

Throughput – Throughput is the number of processes that complete their execution in a given amount of time.

Waiting time – The amount of time that a specific process must wait in the ready queue is referred to as waiting time.

Response time – It is the period from the submission of the request to the delivery of the first response.

Turnaround Time – Turnaround time is the amount of time it takes to complete a task. The entire time spent waiting to get into memory, waiting in the queue, and executing on the CPU is calculate.

Interested in learning about similar topics? Here are a few hand-picked blogs for you!

You may also like