0% found this document useful (0 votes)
67 views

OS Assignment - 4

This document provides instructions for Assignment 4 in an Operating Systems lab course. Students are asked to develop a program that implements Shortest Job First (SJF) non-preemptive CPU scheduling. The program should prompt the user to process one of two examples involving processes with different arrival times and burst times. It should calculate the average turnaround time and waiting time for each example. Students are to perform SJF scheduling manually as well for each example, drawing Gantt charts and calculating metrics for comparison to the program output. Code comments, original logic, and timely submission by the deadline are emphasized.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

OS Assignment - 4

This document provides instructions for Assignment 4 in an Operating Systems lab course. Students are asked to develop a program that implements Shortest Job First (SJF) non-preemptive CPU scheduling. The program should prompt the user to process one of two examples involving processes with different arrival times and burst times. It should calculate the average turnaround time and waiting time for each example. Students are to perform SJF scheduling manually as well for each example, drawing Gantt charts and calculating metrics for comparison to the program output. Code comments, original logic, and timely submission by the deadline are emphasized.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Operation System (LAB)

Assignment 4

INSTRUCTIONS:
You are required to complete the tasks according to the following instructions.

• At the start of each task, in every program, you are required to print PROCESS ID of the process,
your NAME, ROLL NUMBER and SECTION.
• Illustrate the code reason where necessary.

TASK:
In Multiprogramming systems, the Operating system schedules the processes on the CPU to have the
maximum utilization of it and this procedure is called CPU scheduling. There are several algorithms
available that CPU uses to enhance the performance of CPU so that CPU utilization is optimized. One of
such scheduling algorithms is Shortest Job First (SJF). Scheduling may be preemptive or non-preemptive.
In Non-preemptive, once CPU given to the process it cannot be preempted until completes its CPU burst.
In Preemptive, if a new process arrives with CPU burst length less than remaining time of current executing
process, preempt. This scheme is known as the Shortest-Remaining-Time-First (SRTF).
1. You are required to develop a program that schedules the processes residing in the ready queue using
SJF Non-Preemptive.
Example 1:
Process Name Arrival Time Burst Time
A 3 8
B 4 12
C 2 4
D 0 7
E 1 5

Example 2:
Process Name Arrival Time Burst Time
A 3 1
B 4 12
C 2 3
D 0 2
E 1 5

• The program will calculate the Average turnaround time and average waiting time for both
examples by prompting from Menu Screen, if the user want to process example 1 or example
2.
• Also, perform the SJF scheduling manually step by step on your notebook. You will draw gantt
chart, calculate average turnaround time and average waiting time and attach screenshot of
code output and the manual output results of both examples in the Document file.
• Use comments while writing code to increase the understandability of the program.
• CODE must not be copied from any resource, use your own business logic by understanding
the problem statement.
Operation System (LAB)
Assignment 4

NOTE:
• Copy all the attached files (.docx, .c) in a folder. The name of the folder must be like
Section-Roll No. (e.g. E1-0026-BSCS-13).
• You must submit assignment till 08-07-2020 before 05:00 pm. Late submissions will be
marked as ZERO.
• Do not copy anything from others. Plagiarized content will also be marked as ZERO.

You might also like