# Operating Systems. the Gantt Charts Essay

765 WordsMay 14, 20154 Pages
Q1 (ANS). For 3 Processes: The total number of possible different schedules for 3 processes on one processor is: 3! == 6. Gantt Charts: 1. P1 | P2 | P3 | 2. P1 | P3 | P2 | 3. P2 | P1 | P3 | 4. P2 | P3 | P1 | 5. P3 | P1 | P2 | 6. P3 | P2 | P1 | General Formula: For “N” number of processes, the number of possible, different schedules will be N! I.e. N*N-1*N-2*….2*1 Q2 (ANS). (A). 1. SJF Gantt Chart: P4 | P3 | P5 | P1 | P2 | 2. Non Pre-emptive Priority: P2 | P5 | P1 | P3 | P4 | 3. Round Robin Gantt Chart with quantum 4: P1 | P2 | P3 | P4 | P5 | P1 | P2 | P3 | P4 | P5 | P1 | P2 | P3 | P5 | (B). Turnaround Time for all process, in all schedules: Process | SJF | Non Pre-emptive Priority | Round Robin | P1 | 35 | 31 | 41 | P2 | 47 | 12 | 45 | P3 | 16 | 40 | 46 | P4 | 7 | 47 | 35 | P5 | 25 | 21 | 47 | (C). Waiting time for all processes, in all schedules: Process | SJF | Non Pre-emptive Priority | Round Robin | P1 | 26 | 21 | 31 | P2 | 38 | 0 | 33 | P3 | 7 | 31 | 37 | P4 | 0 | 38 | 28 | P5 | 16 | 12 | 38 | (D).The waiting time is least in the SJF (Shortest Job First) scheduling. This is because the long-time taking jobs are pushed back and the shortest time taking jobs are done first. Q3 (ANS). (A). Waiting time for all in FCFS scheduling algorithm: 1. P1 = 0 2. P2 = 7.5 3. P3 = 11 Avg. Turnaround Time = (waiting Time + burst Time for n processes)/n Avg. Turnaround Time = ((0 + 8) + (7.5 + 4) + (11 + 2))/3 Avg. Turnaround Time = 10.83 (B). Waiting time for all processes in SJF scheduling algorithm: 1. P1 = 0 2. P2 = 9.5 3. P3 = 8 Avg. Turnaround Time = (waiting Time + burst Time for n processes)/n Avg. Turnaround Time = ((0 + 8) + (9.5 + 4) + (7+ 2))/3 (= 30.5 / 3) Avg. Turnaround Time = 10.5 (C). Waiting time for