Day 78 - Objectives and Working Of A Scheduler

Scheduling in operating systems is of the main priority in order to maximize the productivity of the computer and efficiently utilize the resources like CPU and Memory. A scheduler is responsible for selecting what process to run at what time and for how much time and what process to put on hold. All of this a scheduler does with the help of scheduling algorithms. But there are some sets of goals a scheduler attemps to achieve.

Objectives Of Scheduling

Following are some of the main objectives that a scheduler may have to achieve in order to maximize the output.

  • CPU Uitlization. It must efficiently utilize CPU to the maximum because it is costly.
  • Resources Utilization. It must also utilize other resources like memory and storage.
  • Waiting Time. A Scheduler should minimize the waiting time for all the processes.
  • Maximize Thoughput. Maximizing thoughput means increasing the number of jobs completed per unit time.
  • Minimize Tunraround Time Turnaround Time = Waiting Time + Computation Time + I/O Time
  • Response Time. It should minimize the response time between the entry of the command until the frist output.
  • Fairness. It must treat all processes equally.
  • Uniformity. The behavour of the system should be predictable.
  • Predictability. A given job should run in about the same amount of time and at about same cost regardless of the system load.

There are many more of them but these are the most common objectives a scheduler must attempt to acheive.

Working Of CPU Scheduling

Short-Term or CPU Scheduler selects the jobs that will run on the CPU and it always select jobs that are already in the memory and ready to go. The Scheduler works in coopertaion with the interrupt system.

  • The scheduler assigns the process to the CPU for performing computation on its behalf.
  • CPU can be borrowed from its current process by the interrupt because it is under the contorl of external devices not the scheduler but interrupts can be disbaled for a short amount of time.
  • When a thread or process asks for I/O request it cannot be processed until the request is not completed so the scheduler will replace the process or thread from the same process in it place until the I/O request is completed.
  • When the process that requested the I/O transfer receives it, it becomes agains elligible to be processed by the CPU.

Above mentioned is a normal scheduler will work with the CPU and processes.


zainscizainsci