Prinsha_Shrestha-Process Scheduling.pptx

PrinshaShrestha 6 views 11 slides Sep 10, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

process scheduling short ppt


Slide Content

CPU Process Scheduling Algorithms By: Prinsha Shrestha 4 th Sept

CPU Process Scheduling Algorithms CPU process scheduling is a critical component of operating systems. It determines how processes are allocated CPU time. It manages what process gets CPU time and for how much time. It ensures that there is maximum utilization of CPU.

First-Come, First-Served (FCFS) Scheduling It is a non preemptive scheduling algorithm. In this algorithm the processes are executed based on their arrival time. Arrival: Processes are added to the queue in order of arrival. Execution: The first process in the queue is executed to completion. Next Process: Once completed, the next process in line begins execution.

First-Come, First-Served (FCFS) Scheduling Advantages: Simple to implement and understand. No starvation; every process will eventually be executed. Disadvantages: A short process may have to wait a long time if a long process is ahead of it. Not suitable for time-sharing systems.

Shortest Job First (SJF) Scheduling It is a non preemptive scheduling algorithm. In this algorithm the processes are executed based on their process time. It chooses the process that takes the shortest time to execute first. Arrival Processes arrive with known execution times. Selection The process with the shortest execution time is chosen. Execution Selected process runs to completion before next selection. Optimization Minimizes average waiting time for a given set of processes.

Shortest Job First (SJF) Scheduling Advantages: Minimizes average waiting time, making it efficient. Suitable for batch systems where job times are known. Disadvantages: Starvation: Longer processes may never get executed if shorter processes keep arriving. Not feasible in real-time systems because burst time isn't always known.

Priority Scheduling It is a preemptive scheduling algorithm. In this algorithm the processes are executed based on the priority of processes. Priority Assignment Each process is assigned a priority value. Higher priority processes are executed first. Execution Order Processes are selected based on their priority. Ties are broken using FCFS. Considerations Can lead to starvation of low-priority processes. Priority can be dynamic or static.

Priority Scheduling Advantages: Important processes can be executed first. Flexible, as priority can be adjusted dynamically. Disadvantages: Starvation: Lower priority processes may never be executed.

Round Robin (RR) Scheduling It is a preemptive scheduling algorithm. In this algorithm the processes are executed for a short time frame known as quantum time. After one execution it moves to next process and so on. Quantum Time A fixed time slice is allocated to each process. Execution Process runs for one time quantum or until completion. Queue Rotation If incomplete, process moves to next process until end of queue. Next Rotation CPU moves to the beginning of process queue and execution continues until all processes are complete.

Round Robin (RR) Scheduling Advantages: Fair allocation of CPU time among processes. Suitable for time-sharing systems. Disadvantages: The choice of quantum is critical; too small can lead to excessive context switching, too large can behave like FCFS. Not optimal for minimizing average waiting time.

Thank You!!
Tags