0% found this document useful (0 votes)
3 views5 pages

Lab 6 New

The document outlines a lab focused on implementing and analyzing CPU scheduling algorithms: First-Come-First-Serve (FCFS), Shortest Job First (SJF), and Round Robin (RR). It discusses the objectives, theory behind CPU scheduling, and performance metrics such as waiting time and turnaround time. The conclusion highlights the strengths and weaknesses of each algorithm, emphasizing SJF's optimality in minimizing waiting time and Round Robin's fairness.

Uploaded by

punitmeme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Lab 6 New

The document outlines a lab focused on implementing and analyzing CPU scheduling algorithms: First-Come-First-Serve (FCFS), Shortest Job First (SJF), and Round Robin (RR). It discusses the objectives, theory behind CPU scheduling, and performance metrics such as waiting time and turnaround time. The conclusion highlights the strengths and weaknesses of each algorithm, emphasizing SJF's optimality in minimizing waiting time and Round Robin's fairness.

Uploaded by

punitmeme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab 6: Process Scheduling Algorithms: FCFS, SJF, and Round Robin (RR)

Objective

●​ To understand and implement CPU scheduling algorithms such as First-Come-First-Serve


(FCFS), Shortest Job First (SJF), and Round Robin (RR)
●​ To analyze their performance metrics

Theory:

CPU Scheduling:

CPU scheduling is a method to allocate the CPU to processes in the ready queue. The goal is to
optimize performance measures such as waiting time, turnaround time, and CPU utilization.

Scheduling Algorithms:

●​ First-Come-First-Serve (FCFS): The simplest scheduling algorithm where the process


that arrives first is executed first. It operates in a non-preemptive mode.​

●​ Shortest Job First (SJF): A non-preemptive algorithm where the process with the
shortest burst time is executed first.​

●​ Round Robin (RR): A preemptive scheduling algorithm where each process is assigned
a fixed time quantum. Processes are executed in a cyclic order, ensuring fairness.​

Performance Metrics

1.​ Waiting Time (WT): The time a process spends waiting in the ready queue.
2.​ Turnaround Time (TAT): The total time taken by a process from arrival to completion.
3.​ Average Waiting Time (AWT): The average of all waiting times.
4.​ Average Turnaround Time (ATAT): The average of all turnaround times.


Conclusion

The lab demonstrated the implementation of three CPU scheduling algorithms: FCFS, SJF, and
RR. FCFS is simple to implement but can lead to the "convoy effect," where shorter processes
are delayed by longer ones. SJF minimizes the average waiting time, making it optimal in many
scenarios; however, it requires prior knowledge of burst times, which might not always be
feasible. Round Robin ensures fairness among processes by allocating a fixed time quantum to
each, but it may lead to increased average waiting time depending on the choice of the quantum.

You might also like