Question: AIM: Write a C program to simulate Shortest Job First CPU scheduling policy with and without Arrival Time. Description: In this policy processes are structured

AIM: Write a C program to simulate Shortest Job First CPU scheduling policy with and without Arrival Time.
Description: In this policy processes are structured in a ready state on the basis of Shortest Job vi
d
Burst Time: Time spent in the running state. [Read]
Wait Time: Time spent in the ready queue. [Start time - arrival time]
Start Time: Time at which Process started its execution
[Equals to arrival (for initial process) or finish time of previous process]
Finish Time: Time at which Process finished its execution [start time + burst time]
Turnaround Time: Time period between its Arrival and Finish. [Finish time - arrival time]
Algorithm:
Start
Read process name, arrival time and burst time
Calculate wait time and turnaround time for each process
Calculate average wait time and turnaround time
Display tabular from of all processes with attributes as follows
\table[[\table[[Process],[Name]],\table[[Arrival],[Time]],\table[[Burst],[Time]],\table[[Wait],[Time]],\table[[Start],[Time]],\table[[Turn],[Around],[Time]],\table[[Finish],[Time]]],[P0,0,10,,,,],[P1,1,15,,,,],[P2,3,5,,,,],[P3,5,25,,,,]]
Display average wait time and turnaround time
Stop
AIM: Write a C program to simulate Shortest Job

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!