So I know that scheduling has been covered in other articles, but because my provided values are different and decimals are used, I am having difficulty wrapping my head around it. I have reviewed all of the other posts already but would like clarification on my specific values if possible.
- What is the average turnaround time for these processes with the FCFS scheduling algorithm?
- What is the average turnaround time for these processes with the nonpreemptive SJF scheduling algorithm?
- The SJF algorithm is supposed to improve performance, but notice that we chose to run process $P_1$ at time 0 because we did not know that two shorter processes would arrive soon. Compute what the average turnaround time will be if the CPU is left idle for the first 2 units and then nonpreemptive SJF scheduling is used. Remember that processes $P_1$ and $P_2$ are waiting during this idle time, so their waiting time may increase.
- What is the average turnaround time for these processes with the preemptive SJF scheduling algorithm?
The values (including a make-shift Gantt chart) are as follows:
1. FCFS
\begin{array} {|r|r|} \hline P_1 &P_2 &P_3 \\ \hline 0-5 &5-8 &8-9 \\ \hline \end{array}
Completion times:
$P_1=5, P_2=8,P_3=9$
Turnaround Time = 5.866667
2. Non-PreEmptive SJF
\begin{array} {|r|r|} \hline P_1 &P_3 &P_2 \\ \hline 0-5 &5-6 &6-9 \\ \hline \end{array}
Completion times:
$P_1=5, P_2=9, P_3=6$
Tunaround Time = 5.2
3. Future-Knowledge (Non-PreEmptive SJF with Idle time)
\begin{array} {|r|r|} \hline - &P_2 &P_3 &P_1 \\ \hline 0-2 &2-5 &5-6 &6-11 \\ \hline \end{array}
Completion times:
$P_1=11,P_2=5,P_3=6$
Turnaround Time = 6.2
4. PreEmptive SJF (SRTF)
\begin{array} {|r|r|} \hline P_1 &P_2 &P_2 &P_3 &P_1 \\ \hline 0-0.4 &0.4-3 &3-3.4 &3.4-4.4 &4.4-9 \\ \hline \end{array}
Completion times:
$P_1=9,P_2=4.4,P_3=3.4$
Turnaround Time = 4.133333333
Hopefully these values are correct. If they are not, could you please explain the process so that I can understand how to properly calculate it myself? Thank you in advance for any assistance!