Longest Job First in Operating System

Shortage of first where we have picked up the shortage jobs and should use them first here we are going to pick the longest jobs and should enjoy them so what is the criteria again first time and the mode is non-preemptive which means once we pick up a job we are going to run it till completion so otherwise we are not going to take it out all right and similarly it will have a pre-emptive version as well we shall see it too first let’s let us do this at time zero what is it what is the process that are available only one process is available therefore I do not have any other choice so I am going to pick up p1 I don’t care whether it is the longest or shortest I have no choice it all right and now by the time three these three become available right isn’t it p2 p3 p4 now among these remaining I am going to pick the next longest what is the longest.
the next longest among the available then it is going to run the run for eight units, therefore, it is totally five units over totally eight units and p4 is going to be over right and then this one also becomes available by the time 8 so now P 1 is over P 4 is over P 1 is over P 4 is over there are the remaining jobs you pick the wrong h1 first so which what is longest one P 5 P Phi is going to transfer 6 units, therefore, six units is of how much 14 here right p5 is over that what is remaining P 2 and P 4 then the next one is an op4 is over right P 4 is over okay this is not over P 2 P 3 is not over now the remaining jobs are P 3 and P 2, therefore, the highest large longest.
One is P 3 among them therefore P 3 is going to run here to the 18 and then P 2 P it is going to run for how much I think it is yeah P 1 P 1 is alright to only soap it is one does but two units and it is 20 right okay I just think you just see this first which is first one which were scheduled is the only one which is available at that time which is p1 and then the and then Benetton the first one finish the time is three therefore all these are p1 p2 p2 p3 p4 are available and among them the longest one is p3 there for schedule is sorry p4 that should hold it and by the time it rains your time is 8 by the time even the p5 is also available they were all are available but then 1 & 4 are over by then then for are over by then therefore in the remaining I’ve taken longest one which is nothing but 6 p5 which you reach transfer 6 units and then p1 p4 p5 are over p1 p4 p5 are over in the remaining 2 p1 and p2 the longest one is p2 therefore if the elongation is p3 therefore p3 schedule and then the next longest one is the p2 therefore P to shade your quad it now let us try this the remaining things.
Turnaround time everything is same completion time turnaround time waiting time and you could even write the response time if you want so this now what is the completion time of p2 is since it is just non-preemptive either you can go from the left-hand side and right-hand side you are going to see every process exactly once so if it is the pre-emptive version when you are talking about completion since a process might occur at various places you should take see the last time a pulse has occurred that is going to give you the completion time right but here it is going to occur.

Leave a Comment