Question: 1 Find Waiting Time Create an array rem _ bt [ ] to keep track of remaining burst time of processes. This array is initially

1 Find Waiting Time
Create an array rem_bt[] to keep track of remaining burst time of processes. This array is initially a copy of plist[].bt (all processes burst times)
Store waiting times of processes in plist[].wt. Initialize this array as 0.
Initialize time : t =0
Keep traversing the all processes while all processes are not done. Do following for ith process if it is not done yet.
If rem_bt[i]> quantum
(i) t = t + quantum
(ii) bt_rem[i]-= quantum;Else // Last cycle for this process
(i) t = t + bt_rem[i];
(ii) plist[i].wt = t - plist[i].bt
(ii) bt_rem[i]=0; // This process is over
2 Find Turn Around Time
Once we have waiting times, we can compute turn around time tat of a process as sum of waiting and burst times, i.e., plist[i].wt + plist[i].bt

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!