Five batch jobs A, B, C, D and E arrive at same time. They haveestimated running times 10, 6, 3, 4 and 8 ms. For each of the followingalgorithm determine mean process turnaround time. Consider processswapping overhead is 1 ms.1) FCFS2) Round-Robin (Time quantum = 2 ms)
Question
Five batch jobs A, B, C, D and E arrive at same time. They haveestimated running times 10, 6, 3, 4 and 8 ms. For each of the followingalgorithm determine mean process turnaround time. Consider processswapping overhead is 1 ms.1) FCFS2) Round-Robin (Time quantum = 2 ms)
Solution
Sure, let's break down each scheduling algorithm and calculate the mean process turnaround time.
- FCFS (First-Come, First-Serve):
In FCFS, the jobs are executed in the order they arrive. The turnaround time for a job is the time from when it arrives until it completes.
- Job A: Arrives at 0 ms, runs for 10 ms. Turnaround time = 10 ms
- Job B: Arrives at 0 ms, starts after A at 10 ms, runs for 6 ms. Turnaround time = 10 + 6 = 16 ms
- Job C: Arrives at 0 ms, starts after B at 16 ms, runs for 3 ms. Turnaround time = 16 + 3 = 19 ms
- Job D: Arrives at 0 ms, starts after C at 19 ms, runs for 4 ms. Turnaround time = 19 + 4 = 23 ms
- Job E: Arrives at 0 ms, starts after D at 23 ms, runs for 8 ms. Turnaround time = 23 + 8 = 31 ms
Mean turnaround time = (10 + 16 + 19 + 23 + 31) / 5 = 19.8 ms
- Round-Robin (Time quantum = 2 ms):
In Round-Robin scheduling, each job is given a fixed time slice (or "quantum") before it is swapped out for the next job.
- Job A: Runs for 2 ms, waits for 8 ms while B-E run, then runs for another 2 ms, and so on. Total turnaround time = 46 ms
- Job B: Runs for 2 ms, waits for 6 ms while C-E and A run, then runs for another 2 ms, and so on. Total turnaround time = 28 ms
- Job C: Runs for 2 ms, waits for 2 ms while D-E and A-B run, then runs for 1 ms. Total turnaround time = 11 ms
- Job D: Runs for 2 ms, waits for 4 ms while E and A-C run, then runs for another 2 ms. Total turnaround time = 18 ms
- Job E: Runs for 2 ms, waits for 6 ms while A-D run, then runs for another 2 ms, and so on. Total turnaround time = 34 ms
Mean turnaround time = (46 + 28 + 11 + 18 + 34) / 5 = 27.4 ms
Please note that the process swapping overhead of 1 ms is not included in these calculations. If you want to include it, you would add 1 ms to the turnaround time of each job every time it is swapped in.
Similar Questions
Consider the following three processes in the FCFS.Process ID. Brust-time. Arrival-timeP1 3 3P2 6 6P3 9 9What is the average waiting time?2345
Consider Five Processes P1 to P5 arrived at same time. They have stimated runningtime 10,2,6,8 and 4 seconds, respectively. Their Priorities are 3,2,5,4 and 1,respectively with 5 being highest Priority. Find the average turnaround time andaverage waiting time for Round- Robin(q=3) and Priority Schedulingalgorithm.
Suppose that the following processes arrive for execution at the times indicated.Each process will run for the amount of time listed. In answering the questions, usenonpreemptive scheduling, and base all decisions on the information you have at the timethe decision must be made.Process Arrival Time Burst TimeP1 0.0 8P2 0.4 4P3 1.0 1a. What is the average turnaround time for these processes with the FCFSscheduling algorithm?b. What is the average turnaround time for these processes with theSJF scheduling algorithm?c. The SJF algorithm is supposed to improve performance, but notice that we choseto run process P1 at time 0 because we did not know that two shorter processes wouldarrive soon. Compute what the average turnaround time will be if the CPU is left idle forthe first 1 unit and then SJF scheduling is used. Remember that processes P1 and P2 arewaiting during this idle time, so their waiting time may increase. This algorithm could becalled future-knowledge scheduling.Exercises 3.Consider the following set of processes, with the length of the CPU burstgiven in milliseconds:Process Burst Time PriorityP1 2 2P2 1 1P3 8 4P4 4 2P5 5 3
Q5. Consider the set of 6 processes whose arrival time and burst time are given below-Arrival time Burst timeP1 0 6P2 1 7P3 2 8P4 3 10P5 4 3P6 5 4If the CPU scheduling policy is Round Robin with time quantum = 3, calculate the average waiting time andaverage turnaround time. For the given scheduling Algorithm (a) FCFS (b) SJF (c) SRTF
Consider the given table below and find Completion time (CT), Turn-around time (TAT), Waiting time (WT), Response time (RT), Average Turn-around time and Average Waiting time in case of FCFS scheduling. Process ID Arrival time Burst time P1 2 2 P2 5 6 P3 0 4 P4 0 7 P5 7 4a.The waiting time for process P1 is 9msb.The waiting time for process P1 is 0msc.The waiting time for process P1 is 8msd.The waiting time for process P1 is 4ms
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.