0% found this document useful (0 votes)
14 views4 pages

Simran 41721016 OS Program 3

The document outlines the implementation of the Shortest Job First (SJF) CPU scheduling policy, which selects processes based on the smallest total burst time to minimize waiting time and optimize CPU utilization. It highlights the advantages of SJF, such as reduced average waiting time and improved turnaround times, as well as its disadvantages, including potential starvation of longer processes and challenges in predicting burst times. The conclusion states that the SJF scheduling policy has been successfully implemented in a program, with output provided.

Uploaded by

Simran tomar
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)
14 views4 pages

Simran 41721016 OS Program 3

The document outlines the implementation of the Shortest Job First (SJF) CPU scheduling policy, which selects processes based on the smallest total burst time to minimize waiting time and optimize CPU utilization. It highlights the advantages of SJF, such as reduced average waiting time and improved turnaround times, as well as its disadvantages, including potential starvation of longer processes and challenges in predicting burst times. The conclusion states that the SJF scheduling policy has been successfully implemented in a program, with output provided.

Uploaded by

Simran tomar
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/ 4

Experiment-03

AIM: Write a program to implement Shortest Job First CPU Scheduling Policy.
The Shortest Job First (SJF) CPU scheduling policy is a non-preamptive scheduling algorithm
that selects the process with the smallest total burst time to execute next. It aims to
minimize the waiting time of processes and optimize CPU utilization by choosing the
shortest job available for execution.
In SJF scheduling, processes are ordered based on their burst times (time required for
execution), with the shortest jobs first. When a process arrives or completes its execution,
the scheduler selects the process with the smallest burst time from the ready queue.

Advantages:
• SJF scheduling minimizes the average waiting time, making it an efficient scheduling
algorithm in terms of response time.
• It provides better turnaround times for processes compared to many other
scheduling algorithms.

Disadvantages:
• SJF scheduling may lead to starvation, where longer processes never get a chance to
execute if a continuous stream of short jobs arrives.
• Predicting the exact burst time of processes in advance can be challenging, making
SJF less practical for some scenarios.
• It is a non-preamptive algorithm, which means that once a process starts executing,
it cannot be interrupted. Preamptive versions of SJF exist to address this limitation.

Code for Implementation:


Output:

Conclusion: Shortest Job First CPU Scheduling Policy has been implemented through the
program and the output is attached.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy