2. ➢ CPU scheduling
➢ Multilevel queue scheduling
➢ First priority preemptive scheduling method.
➢ Time slicing method
➢ Advantage and Disadvantage
➢ Conclusion
Overview
3. What is CPU Scheduling?
CPU Scheduling is a process of determining which process
will own CPU for execution while another process is on
hold.
The Processes that needs to be executed are kept into
the ready queue and then they are executed one by one in
the CPU.
4. But…
In real life, there are more than one type of processes
like..
System Process
Interactive
Process
Background
Process
If we have different types of processes then why
there’s just one ready queue for all of them!!
5. MULTILEVEL QUEUE SCHEDULING
● Multilevel queue scheduling is a type of CPU
scheduling in which the processes in the
ready state are divided into different
groups, each group having its own scheduling
needs.
● The ready queue is divided into different
queues according to different properties of
the process like memory size, process
priority, or process type.
6. Suppose there are 3 processes ready to execute:
1. System process
The CPU stops executing other processes when system
interrupts.
That’s why it has the highest priority.
2. Interactive process
Process where we can directly interact with the application.
That’s why it’s priority is less than system process.
3. Background process
Where we give multiple processes to the system and system
will keep executing the processes in the background.
It has the lowest priority.
7. ● There must be different queue for every process, that means each
process will have its own queue.
● Each queue is assigned an absolute priority over other queues
System process queue > Interactive process queue > Background process queue
● This method is called
first priority preemptive
scheduling method.
● Overall gist of this
method is that run the
processes with higher
priority first and then
the processes with
subsequent priority.
8. Time Slicing method:
In this method, processes from each queue are run for a fixed amount
of time, and then we move on to the next queue. When we arrive at
the last queue, we run it for a specific amount of time, and then we
move back to the first queue.
For example, queue one runs for 50% of CPU time, queue two runs for
30% of CPU time, and queue three runs for 20% of CPU time. In this
way, the total CPU time is divided among each queue to run their
processes.
9. We need to run the processes in all the queues in the same
manner, or we can have different implementations for each queue.
There are many algorithms using which we can decide the process
to be run first and for how long.
For example:
● The system process queue can use FCFS(First Come, First
Serve) scheduling.
● The interactive process queue can use SJF(Shortest Job
First) scheduling.
● The batch process queue can use RR(Round Robin)
scheduling.
12. Advantages:
It allows us to apply different scheduling algorithms for different
processes.
It offers a low scheduling overhead, i.e., the time taken by the dispatcher
to move the process from the ready state to the running state is low.
Dispatcher performs the task of allocating the selected process to the CPU.
Disadvantages:
There are chances of starvation for lower priority processes. If higher
priority processes keep coming, then the lower priority processes won't
get an opportunity to go into the running state.
Multilevel queue scheduling is inflexible.
13. Conclusion:
● Multilevel Queue Scheduling is a part of CPU scheduling.
● For each different types of processes has its own queue
which executes from highest priority to the lowest
priority.
● There are many algorithms that can be used to run the
process.
● Multilevel Queue Scheduling has its advantages as well as
disadvantages like Starvation, that’s why we use Multilevel
feedback Queue Scheduling