Process scheduling C program code explanation * Description: The…
Question Answered step-by-step Process scheduling C program code explanation * Description: The… Process scheduling C program code explanation* Description: The following is a process scheduling that perform a run of the following algorithm. It generates a set of simulated processes. Each simulated process is simply a small data structure that stores information about the process that it represents. For each process, randomly generate: An arrival time An burst time. Assume only one CPU and one ready queue. It sort the simulated processes so that they enter the queue in arrival time order. It is only considered CPU time for each process (no I/O wait times). Each simulation run should last until the completion of the last process. It runs each algorithm 3 times to get averages for the statistics below. Outputs for each algorithm run (total 3 runs) Create 10 processes only. Each created process’s name (such as P1, P2, P3, P4, P5,,,,etc), arrival time, burst time Calculated statistics for the processes for the run: Waiting time for each run Turnaround time for each run Average waiting time for each run Average turnaround time for each run* Question: Explain line by line the following C language programming process scheduling algorithm showing the efficiency of First-come first served (FCFS) in the following code. Provide a deep explaination how the code is efficient and functional due to the description above.* C program:#include /* basic I/O routines. */#include /* define fork(), etc. */#include /* define pid_t, etc. */#include /* define wait(), etc. */#include /* define signal(), etc. */#include /* multithreads , etc. */#include /* standard library of c, etc. */#include /* data type, etc. */#include /* declartion for wait, etc. */#include /* standard symbolic constants and types, etc. */#include int main(){int i,n=10,j,p[10]={1,2,3,4,5,6,7,8,9.10};int bt[10],at[10],wt[10],tat[10],temp;int ct=0;float avgwt=0,avgtat=0,Executiontime,throughput; clock_t start,end; start=clock(); srand(time(NULL)); for(i=0;i Engineering & Technology Computer Science CS 4610 Share QuestionEmailCopy link Comments (0)


