CS Electrical And Electronics
@cselectricalandelectronics
All PostsElectronicsOperating SystemWhat Is

What is Process Scheduling in Operating System, Types Of Process Scheduling

Hello guys, welcome back to my blog. In this article, I will discuss what is processing scheduling in operating system, process scheduling queues, its objectives, type of Process Schedulers, etc.

If you have any doubts related to electrical, electronics, and computer science, then ask question. You can also catch me @ Instagram – Chetan Shidling. 

Also, read:

Process Scheduling in Operating System

A Multiprogramming operating system’s process scheduling is critical. This is because multiple processes can be loaded into executable memory simultaneously in such operating systems, and the loaded processes share the CPU utilizing temporal multiplexing. The process scheduler is in charge of determining which processes should be run and for how long. Therefore, a scheduler is an important component of any multitasking operating system, such as Linux.

A multitasking operating system gives the impression that numerous processes are running simultaneously when there are only a few processors available. Preemptive and cooperative multitasking operating systems are the two types of multitasking operating systems.

What is Process Scheduling?

Process Scheduling is a task in the operating system that schedules processes in various states such as ready, waiting, and running. Process scheduling allows the operating system to assign each process a time interval for CPU execution.

Another significant advantage of employing a process scheduling system is that it keeps the CPU active at all times. This enables you to achieve the quickest possible reaction time for applications.

Process Scheduling Queues:

Process Scheduling Queues enable you to have a separate queue for each process state and PCB. All processes in the same state of the execution are placed in the same queue. As a result, if a process’s status is changed, its PCB must be unlinked from its old queue and redirected to the new state queue. There are three different types of operating system queues:

01. Job queue – It aids in the storage of all processes in the system.

02. Ready queue – This queue type allows you to create a list of all the currently running processes in the main memory and are ready to execute.

03. Device queues – It is a procedure that has been halted due to the lack of an I/O device.

Scheduling Objectives:

The following are some of the essential Process Scheduling goals.

  • Increase the number of interactive users while keeping response times to a minimum.
  • Find a happy medium between response and utilization.
  • Avoid procrastinating indefinitely and stick to your priorities.
  • It should also mention the procedures that hold the important resources.

Type of Process Schedulers:

A scheduler is a piece of system software that allows you to manage the scheduling of processes. Process schedulers are divided into three categories:

  1. Long Term
  2. Short Term
  3. Medium Term

01. Long Term Scheduler:

A job scheduler is another name for it. A long-term scheduler determines which programs are accepted for processing into the system. It chooses processes from the queue and loads them into memory so they can be executed. For CPU scheduling, the process loads into memory. The job scheduler’s main goal is to deliver a balanced mix of jobs, such as I/O bound and CPU bound workloads. It also regulates how much multiprogramming is done.

If the degree of multiprogramming remains constant, the average rate of process creation must be equal to the average rate of process departure from the system. The long-term scheduler may or may not be available on some systems. For example, there is no long-term scheduler in time-sharing operating systems. Instead, long-term schedulers are used when a process transitions from a new to a ready state.

02. Short Term Scheduler:

It’s also referred to as a CPU scheduler. Its primary goal is to improve system performance by the set of criteria established. It is the transition from the process’s ready to running stage.

The CPU scheduler chooses a process from among those ready to run and allocates the CPU to that process. Short-term schedulers usually referred to as dispatchers, decide which process to run next. Longterm schedulers take longer than short-term schedulers.

03. Medium Term Scheduler:

Swapping includes medium-term scheduling. It clears the memory of the processes. Multiprogramming is reduced as a result. The medium-term scheduler handles the swapped-out processes. If a running process makes an I/O request, it may be suspended. A process that has been suspended cannot make any progress toward completion.

The suspended process is transferred to secondary storage in this situation to remove it from memory and make room for other processes. This is known as switching, and the procedure is referred to as being switched out or rolled out. To optimize the process mix, swapping may be essential.

Context Switch:

A context switch is a mechanism in the Process Control block that stores and restores the state or context of a CPU so that a process execution can be resumed from the same point later. A context switcher uses this technique to allow numerous programs to share a single CPU. Context switching is one of the most important elements of a multitasking operating system.

The status of the currently running process is recorded in the process control block when the scheduler changes the CPU from one process to another. The state for the following process is then loaded from its own PCB and used to set the PC, registers, and so on. After then, the second procedure can begin to run.

Because register and memory state must be preserved and recovered, context switches are computationally demanding. As a result, some hardware systems use two or more processor registers to save context switching time. To sum up, Linux’s process scheduler is a crucial component.

It gives the idea that numerous processes are running simultaneously, but in reality, the number of processes executing is restricted by the number of processors available. Varying tasks (I/O-bound vs. CPU-bound) have different requirements. To create a responsive and successful experience, the scheduler must consider each of these scenarios.

I hope this article “Process Scheduling in Operating System” may help you all a lot. Thank you for reading.

Also, read:

Share Now

Mayank Rochani

Content Writer