0
Process  -  Arrival Time    -   Burst Time

    P1   -      0.0         -    7

    P2   -      0.5         -    3

    P3   -      1.0         -    2

Additional info: Schedule is non-pre-emptive.

Question: What is the average turnaround time (ATT) for these processes with the Shortest Job First (SJB) scheduling algorithm?

What I was thinking either: P3,P2,P1 but since it's non-pre-emptive and P1 arrives at 0.0 it's P1,P2,P3

 ATT P1 = 0
 ATT P2 = 6,5
 ATT P3 = 9

Am I doing this right?

BartoszKP
  • 34,786
  • 15
  • 102
  • 130

1 Answers1

1

First, the average turnaroud time, as the name suggests, is an average over the individual turnaround times. So there can only be a single value for the entire setup.

Second, even though the schedule is non-preemptive, the scheduler can decide on any waiting process after a process finishes. At first, only P1 is available for scheduling. After P1 finishes, P2 and P3 are in the queue, where P3 is the shorter job. Therefore, the correct schedule would be P1, P3, P2.

andy
  • 2,002
  • 1
  • 12
  • 21