Professional Documents
Culture Documents
Presented By
In the operating system, everything is carried out by processes. At any given time, there is only one
process that is running on the CPU.
A process scheduler removes one process from the running state in the CPU and selects another process
to run based on some scheduling algorithms in OS.
A CPU scheduling algorithm is used to determine which process will use CPU for execution and which
processes to hold or remove from execution.
The main goal or objective of CPU scheduling algorithms in OS is to make sure that the CPU is never in
an idle state, meaning that the OS has at least one of the processes ready for execution among the
available processes in the ready queue.
Why do we need these algorithms ?
1.Fairness: The scheduler aims to allocate CPU time fairly among all processes or threads. This prevents any single process from monopolizing
system resources and ensures that all processes get a reasonable share of CPU time, regardless of their priority or resource requirements.
2.CPU Utilization: The scheduler's goal is to keep the CPU busy and maximize its utilization. It should minimize idle time and ensure that
processes are always available for execution as long as there are processes in the ready queue.
3.Throughput: Throughput refers to the number of processes completed per unit of time. Scheduling algorithms aim to maximize throughput by efficiently
processing a high number of processes in a given time frame.
4.Turnaround Time: Turnaround time is the total time taken from the submission of a process to its completion. Scheduling algorithms strive to minimize
turnaround time, which contributes to efficient resource utilization and faster process completion.
5.Waiting Time: Waiting time is the amount of time a process spends in the ready queue waiting for CPU time. Scheduling algorithms aim to minimize
waiting time, as excessive waiting can lead to inefficiencies and slower process execution.
6.Priority Management: Some scheduling algorithms support process priorities, allowing higher-priority processes to receive more CPU time than lower-
priority ones. This helps in giving preferential treatment to critical tasks.
TYPES OF SCHEDULING
ALGORITHMS :