2. Maximum CPU utilization obtained with multiprogramming.
Scheduling :- A method of assigning CPU to a process.
Scheduling is the basis of multi-programmed OS.
5. A module that selects a process, for assigning CPU to it .
It Involves 2 Steps : Switching Context.
Jumping to the proper location in the
program to re-start the program.
Dispatch Latency :- Time it takes for the dispatcher to
stop one process and start another
6. Non-Preemptive Scheduling
Once A process is allocated the CPU, it does not leave
It has to wait for an I/O request.
OS can force (preempt) A process from CPU at
anytime. For example : To allocate CPU to another higher priority
Due to end of time slice.
7. 1. When A process switches from the running state to waiting state
( due to an I/O request ).
2. When A process switches from the running state to ready state (
due to end of time slice ).
3. When A process switches from the waiting state to ready state (
at completion of I/O ).
4. When A process terminates.
8. CPU Utilization – Keep the CPU as busy as possible.
Throughput – Number of processes that complete their execution per
Turnaround Time – Amount of time to execute A particular process.
Waiting Time – Amount of time A process has been waiting in the
Response Time – Amount of time it takes from when A request was
submitted until the first response is produced, not
output (for time-sharing environment).
10. Simplest algorithm.
Processes assigned in the order they request.
Single queue of ready processes .
FIFO queue structure.
When the process joins the ready queue , it is linked to
the tail of the FIFO queue.
When the CPU is idle, the process at the head of the
FIFO queue is allocated to the CPU and deleted from the
Easy to understand.
Easy to program.
Single queue keeps track of all ready
Picking a process to run, just requires
removing one from the head of the queue.
Adding a new process or unblocked process
just requires attaching it to the tail of the queue.
The average waiting time is often quite long .
Its average waiting time varies if the CPU
burst times vary greatly.
Small process wait for one big process.
Not suited for time sharing systems.
14. Designed for time sharing systems.
Process assigned a time interval, called quantum.
CPU scheduler allocates each process in the ready queue
one time slice at a time.
Follow FIFO queue structure.
Processes allocated to the CPU may have the current CPU
burst:1. equal to the time slice
2. smaller than the time slice
3. greater than the time slice
In first two cases, process will release the CPU by its own.
In the third case, the current process is preempted.
Simple and easy to implement.
Each processes get equal chance to execute.
Handling all processes without priority.
Depend upon the length of the time slice.
Same as FCFS, if time slice is indefinitely large.
Small time slice will deteriorates due to frequent context
17. ► A priority number (integer) is associated with each process.
► Smallest integer ≡ Highest priority.
► The CPU is allocated to the process with highest priority.
► Can be Preemptive or Non-preemptive.
► Equal priority processes are scheduled on FCFS.
►If system eventually crashes, all low priority processes get lost.
► Indefinite blocking or Starvation.
► Aging :- As time increases , increase in the priority of a process.
► Suitable for applications with varying time and resource
20. ► Length of CPU burst of each process is considered.
► Process with the smallest CPU burst, will be executed first.
► In case of tie between processes, FCFS is used.
► SJF is optimal :- Gives minimum average waiting time for a
given set of processes.
Arrival time (ms)
Burst time (ms)
SJF Preemptive Scheduling,
Average waiting time = 6.5 ms
SJF Non-preemptive scheduling,
Average waiting time = 7.75 ms
► Produces the minimum average turnaround time.
► Reduces average waiting time.
► Accurate length of CPU burst is not known.
► Some risk of Starvation for longer processes.