You are on page 1of 9

Operating System

Module 2-Lecture 5
Scheduling Part 2
Dr. Mainak Biswas
Scheduling Algorithms
1. First-Come, First-Serve Scheduling
2. Shortest-Job-First Scheduling
3. Preemptive Shortest-Job-First Scheduling
4. Priority Scheduling
5. Round-Robin Scheduling
6. Multilevel Queue Scheduling
7. Multilevel Feedback Queue Scheduling
First-Come, First-Serve Scheduling
With this scheme, the process that requests the CPU first is allocated
the CPU first.

Avg. Waiting Time:

However if P2 and P3 is considered earlier

Avg. Waiting Time:


Shortest-Job-First Scheduling
When the CPU is available, it is assigned to the process that has the
smallest next CPU burst

Avg. Waiting Time:


Preemptive Shortest-Job-First Scheduling
• A preemptive SJF algorithm will preempt the currently executing process, whereas a non-preemptive
SJF algorithm will allow the currently running process to finish its CPU burst
• Preemptive SJF scheduling is sometimes called shortest-remaining-time-first scheduling

Avg. Waiting Time:


PU
Priority Scheduling
A priority is associated with each process, and the CPU is allocated to the process
with the highest priority. A major problem with priority scheduling algorithms is
indefinite blocking, or starvation

Avg. Waiting Time:


Round-Robin Scheduling
• It is similar to FCFS scheduling, but preemption is added to enable the system to switch
between processes
• A small unit of time, called a time quantum or time slice, is defined
• The CPU scheduler goes around the ready queue, allocating the CPU to each process for a
time interval of up to 1 time quantum.

Avg. Waiting Time:


Multilevel Queue Scheduling
• A multilevel queue scheduling algorithm partitions the ready queue into several
separate queues
• Each queue has its own scheduling algorithm.

CPU
Multilevel Feedback Queue Scheduling
• The multilevel feedback queue scheduling algorithm allows a process
to move between queues
• process that waits too long in a lower-priority queue may be moved
to a higher-priority queue

You might also like