In: Computer Science
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:
Process Arrival Time Burst Time
P1 0 5
P2 2 3
P3 3 2
P4 4 4
P5 5 3
a. Draw Gantt charts illustrating the execution of these processes using SJF pre-emptive
b. What is the turnaround time of each process for each of the scheduling algorithms
c. What is the waiting time of each process for each of the scheduling algorithms
A)
Since there are situations in which there might be two or more processes with the same remaining processing time , we chose the one which arrived first. Sometimes, like in the following case, choosing the first process saves us unnecessary swapping of processes.
B) Turnaround Time = Exit Time - Arrival Time
C) Waiting Time = Turnaround Time - Burst Time
Please comment in case of doubts or queries.
It would be really helpful if you could upvote :)