What is Scheduling? The Allocation of CPU time (Resources) to different jobs to be processed on the computer is called scheduling and the module of an operating system which handle this task is called scheduling. Scheduler arranges jobs in the sequences base in the priority. In the time-sharing system, all the resources of the computer system are shared among the different user. as CPU is one of the primary computer resources so the sharing of CPU time among different user (Jobs) is term as scheduling. The Scheduler has to make a decision that which process should be given CPU time when and how much.
SCHEDULING IN OPERATING SYSTEM
The following are well know scheduler algorithm.
a). NON-PREEMPTIVE ALGORITHM
In this strategy when a process is assigned to CPU will not be swapped (stopped or Blocked) before its completion.
a.i. FIFO. (First in first out)
In this algorithm, all the incoming jobs are placed in Queue and are proceed one by one at first come first out.
a.ii LIFO (Last in First cut)
In this Strategy incoming jobs are placed in a stack and CPU is assigned to a job which is at the top of the stack. However, it is a scheduler algorithm but it is not actually applied.
a.iii SJF (Shortest Job First)
According to this algorithm, first of all, all active process are stored according to their size and the shortest job is arranged high priority it means that a job requires less memory will be given high priority. When CPU is executing some processes, at the same time a new process arrived. All the remaining processes again arranged according to the size.
b). PRE-EMPTIVE ALGORITHM
In this strategy when a process is assigned to CPU can be swapped (stopped) before its completion and a new process is assigned to CPU.
b.i SJN (Shortest job next)
In this strategy all the process are arranged according to their size from the smaller to larger and highest’ priority is assigned to the smaller process. Suppose a process is assigned to Processor a new job arrived If the remaining portion of current jobless then the new. Then current process will be swapped from CPU (block state) and new process assign to processor (running State)
b.ii RR (Round Robbins algorithm)
In this scheduling method, the process is dispatched FIFO and no priority is assigned to any job, all the active job are given a limited amount of CPU time called a time slice or quantum. If a process doesn’t complete before it CPU time expires, then this process is preemptive and CPU has given to the next waiting process. The preempted process is placed at the back of the ready list.