I have doubt in above solution, that is p3 finished at 5, and arr time of p5 is 5.so shouldn't we start p5 even though it is not shortest but its arr time is 5 instead of starting p2.

its correct, thats preemptive, so we have to check after each new job arrive what is the remaining time, and the one with the shortest remaining time gets the priority.

process name | Arrival time | burst time A | 0 | 4 B | 2 | 7 C | 3 | 2 D | 3 | 2 plz any one tell the waiting time and turn arround time for each process

p2 avg waiting time is wrong it should be

ReplyDelete9+0+0+2/4

its correct...it is 9 + 1 + 0 + 2 / 4

ReplyDeleteProcess | Arrival Time | Burst Time

ReplyDelete-----------------------------------

P1 | 0.0 | 5

P2 | 3.0 | 5

P3 | 5.0 | 3

P4 | 7.0 | 2

Average Waiting Time and Gantt Chart using Shortest Job First (Preemptive)

Please Can you tell me how to solve this ?

I have doubt in above solution, that is p3 finished at 5, and arr time of p5 is 5.so shouldn't we start p5 even though it is not shortest but its arr time is 5 instead of starting p2.

ReplyDeletesame confusion here i think p2 should nt come after p3 p4 should cz its arrival time is 5 nd p3 completes ob 5

ReplyDeleteits completey wrong ...its sjf means short job should come first so according to that p3,p2,p4,p1 is d correct way

ReplyDeletegoodboy u are right

ReplyDeleteits correct, thats preemptive, so we have to check after each new job arrive what is the remaining time, and the one with the shortest remaining time gets the priority.

ReplyDeleteprocess name | Arrival time | burst time

ReplyDeleteA | 0 | 4

B | 2 | 7

C | 3 | 2

D | 3 | 2 plz any one tell the waiting time and turn arround time for each process

PELER

ReplyDeletep1 = 0+ (11-2) =9

ReplyDeletep2= 2+ (5-4)=3-2 =1

p3 = 4- 4 = 0

p4=7-5=2

9+1+0+2=12/4 = 3