Question: Create a program in C that will run two different scheduling algorithms and compare the waiting time of each process and the average waiting time

 Create a program in C that will run two different scheduling

Create a program in C that will run two different scheduling algorithms and compare the waiting time of each process and the average waiting time of the complete set of processes. The program will begin by getting the processes file as an inline parameter and will read the contents in an array. The program will then create a child process to run the FCFS scheduling algorithm and then another child to run the SJF algorithm. Each child will print the waiting time of each process when it finishes and the average waiting time when all processes are complete. Example: FCFS: P1 Waiting time: 0 FCFS: P2 Waiting time: 10 FCFS: P3 Waiting time: 25 SJE: P1 Waiting time: 10 SJF: P2 Waiting time: 0 SJE: P3 Waiting time: 25 FCFS: Average Waiting Time: 35/3 SJF: Average Waiting Time: 35/3

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 Databases Questions!