Operating System

Operating System Process Scheduling

Operating System Process Scheduling

There are numerous sorts of Process Schedulers:

  • Long Term Scheduler
  • Short Term Scheduler
  • Medium Term Scheduler 

Long Term Scheduler: – future scheduler is additionally mentioned as Job Scheduler. The objective of the Long-term scheduler is to select the function from supplementary storage and keep them within the ready queue, which is within the primary storage. The best task accomplished by the LTS (Long term schedular) is to select the perfect combination of IO(Input output)-bound and CPU(central processing unit) bound methods from the work pool. If any situation arises when job schedulers want to pick quite one IO process then thanks to this, there could also be an opportunity that each one the roles enter into the blocked state, and a maximum of the time, the CPU will remain in a perfect state, and thanks to this, the degree of multi-programming gets reduced. Therefore, the long-term scheduler ought to choose both IO and CPU bound processes professionally and fittingly.

Short Term Scheduler: – The task performed by the short-term scheduler is to settle on one among the roles from the ready queue and send it for execution to the CPU. Short Term Scheduler means a CPU scheduler. briefly term scheduler, we use a scheduling algorithm to settle on the work for execution. In some cases, the work of the short-term scheduler could also be critical like if the CPU burst time of a specific job is high. Then the opposite jobs will need to await an extended time within the ready queue. This problem is named Starvation.

Medium Term Scheduler: – The Medium-term scheduler is liable for having the method suspended and resumed. It generally changes the moving processes from main memory to disk and disk to main memory. Within the medium-term scheduler, swapping is employed to extend the performance of the method mix or thanks to changes within the requirements of memory that have over-engaged available memory that needs memory to be released.

Process Queue

The OS handles many queues for a process state. The process-related to program control block (PCB) is additionally stored during a queue. When the method switches the state from one state to a different state, then the PCB (Program Control Block) of that process is additionally getting unlinked from the queue then link to a different state queue during which the transition takes place.

There are various sorts of queues:

  • Job Queue
  • Ready Queue
  • Waiting Queue

Job Queue: – All processes are placed within the job queue at the start. it's kept in auxiliary storage. The long-term scheduler selects a couple of the roles and places them within the primary storage.

Ready Queue: – the first memory holds the ready queue. within the ready queue with the assistance of the short-term scheduler, we select the work for the execution from the ready queue, then we'll dispatch it to the CPU.

Waiting Queue: – within the ready queue, if the method requires performing some operations means any input/output operation to finish its execution, then it's just that the OS switches the method state from running to the waiting state. The framework Program Control Block is stored within the waiting queue which will be employed by the processor when the IO is completed.