Do you have your schedule? Then, you know how hard it is to create one. Even CPUs need to schedule. So, what are the types of scheduling?
First, we will look at why CPU scheduling is essential. Also, we will discuss the two types of CPU scheduling.
We will then discuss and list CPU Algorithms computer scientists have defined. These algorithms back up our types of scheduling.
It is a process that allows one process to use the CPU while another process is on hold or in a waiting state. This is because resources are unavailable like input/output, etc. Thus, making full use of the CPU.
Moreover, CPU scheduling aims to make an efficient, fast, and fair system. Whenever the CPU becomes inactive, the operating system will pick a process in the ready queue. Then, executes it.
The CPU scheduler carries the process of selection. After it selects a process, it allocates the CPU to one of them.
Types of Scheduling
Under this type of schedule, there are things to consider. For example, once the CPU has been specified to do a certain process, the CPU keeps on running.
Eventually, the process will stop until it releases the CPU. To stop the process, you can either terminate it or switch it to the waiting state.
Resources are used and then held by the process until it gets terminated. Besides, the process is not interrupted it’s complete. Starvation can occur when a process with a large burst time occupies the system. No such overheads are in need.
As a basis, this scheduling follows the non-preemptive priority algorithm. Also, the shortest Job first algorithm.
Unlike the other, the tasks are usually assigned through priorities. Aside from that, there is a necessity to run high-priority commands. Then, go on to another task even though it is running.
Unfortunately, the running task will be interrupted for a while. But, it will automatically resume until the priority task is finished. Thus, resources are allocated according to the cycles for a limited time.
You can interrupt the process, even before the completion. Starvation may be caused, due to the insertion of a priority process in the queue. Thus, maintaining queue and remaining time needs storage overhead.
Algorithms that are backed by preemptive Scheduling are round-robin (RR), priority, SRTF (shortest remaining time first).
First Come First Serve Scheduling
As the name suggests, the process which arrives first gets executed first. To summarize things, the process which requests the CPU first gets the CPU’s attention first.
Shortest Job First scheduling works on the process with the shortest burst time or duration first.
It is a process that is the most required. As a result, the CPU processes it first. Then, followed by the ones with lesser priority in order.
Round Robin Scheduling
After it executes one process, the process is preempted. As a result, another process executes for the given period.
Multi-level Queue Scheduling
Processes are easily classified into different groups.