CPU
Scheduling
Presented by: Md. Amanat Rasool
Introduction
CPU scheduling is a key part of how an Operating System(OS)
works. CPU scheduling determines which process will use the
CPU for execution at any given time. This is crucial because the
CPU can process only one task at a time and effective
scheduling helps to improve the performance &
responsiveness of the system.
Objectives of CPU Scheduling:
1. Maximize CPU Utilization: Keep the CPU as busy as possible.
2. Minimize Throughput: Improve the CPU utilization.
3. Minimize Waiting Time: minimize the amount of time processes wait in
memory.
4. Minimize Time-around Time: Reduce the total time taken for a process
to complete.
5. Minimize Response Time: Reduce the time processes spend in the ready
queue.
Types of CPU Scheduling
Algorithms:
CPU Scheduling algorithms categorized into preemptive
and non-preemptive algorithm.
I) Non-Preemptive CPU Scheduling Algorithms :-These algorithms
are typically simpler and easy to implement.
1) First Come First Serve(FCFS): The process that arrive first in the ready
waitlist(queue) is executed first, followed by second process and so on.
II) Preemptive CPU Scheduling Algorithms:-
These algorithms tend to be more complex and dynamic, often allowing
for preemption and sophisticated management of processes.
1) Shortest Remaining Path First(SRPF): In SRPF scheduling, the
process with the least burst time remaining is executed first. SRPF is
preemptive type.
2) Priority: In priority scheduled, processes are based on the CPU and
memory requirements. The processes with the highest priority is executed
first followed by lower priority processes. Priority scheduling can be both
preemptive and non-preemptive.
Conclusion
Effective CPU scheduling is vital for maximizing system
performance and ensuring that all processes receive fair
access to CPU resources. Each scheduling algorithm has its
strengths and weaknesses, making the choice dependent on
system requirements and workload characteristics.