CPU scheduling is the mechanism of deciding which process will hold the CPU for execution while other process is on wait. A scheduling algorithm is a way of selecting a process from a ready queue and putting it in the CPU. The main function of CPU scheduling is to make assure that when the CPU is inactive, the operating system at least picks one process present in the ready queue for execution.
Scheduling of processes is effective for completing the task on time. The goal of scheduling is to make the system competent, fast, and tolerable. The selection of processes is managed by the short-term scheduler. The scheduler picks the process which is ready to run and assigns the CPU to one of them.
There are two types of Scheduling algorithms
Preemptive
If we took out a process from RAM and placed in running queue, then we can stop that process from executing and place again in ready queue. So, that it will execute in future. This is known as preemptive.
Non-preemptive
Non preemptive means that if we took out a process from ready queue and gave to CPU to get it executed then that process will get fully executed. In this case we canโt stop the processes from the executions.
Similar Reads
-
Advantages and Disadvantage of User level and Kernel Level Threads
User-Level Threads Advantages of User-Level Threads Speed and Efficiency: Operations such as thread creation, switching, and destruction are faster because… -
Difference Between User-level and kernel-level thread
User-level and kernel-level threads represent two approaches to thread management in operating systems. Both have some differences Difference Between User-level… -
What is Deadlock in OS? Explain with the help of a diagram.
A deadlock is a condition where each of the processes is waiting for a resource which is allotted to other… -
Preemptive and Non-Preemptive Algorithm in Operating System
Preemptive Scheduling Algorithm Here, a scheduler can preempt a running low-priority process at any time when a high-priority process enters… -
CPU scheduling algorithms Criteria in Operating System
There are different criteria for the CPU scheduling algorithm. CPU scheduling algorithms Criteria are CPU utilization: The main purpose of… -
Sleeping Barber Problem of Synchronization in Operating System
It is a synchronization and inter-process communication problem. This problem is based on a barbershop. A barbershop has a single… -
Reader-Writer Problem in Operating System with Code
The readers and writers problem based on an object like a file which is shared in different processes. Some processes… -
Discuss the Classical problem of synchronization
Using semaphores for synchronization is the traditional way to present the solutions. There are four types of the classical problem… -
Semaphore in Operating System and its types
A semaphore is simply an integer variable that is shared between multiple threads. We can also say A semaphore is… -
Mutual exclusion in Operating System with its four conditions
When a process is executed in a critical section, then no other process can be executed in their critical section.…