Questions on CPU Scheduling(FCFS)

Question 1: Calculate Avg TAT & Avg WT.

P.No AT BT
1 0 4
2 1 3
3 2 1
4 3 2
5 4 5
Solution : TAT=CT-AT & WT=TAT-BT gantt sol 1
P.No AT BT CT TAT=CT-AT WT=TAT-BT
1 0 4 4=CT for P1 4 0
2 1 3 7=CT for P2 6 3
3 2 1 8=CT for P3 6 5
4 3 2 10=CT for P4 7 5
5 4 5 15=CT for P5 11 6
        AVG=34/5=6.8 Avg=19/5=3.8
  Question 2: Avg TAT=? Avg WT=?
   (A)   (B)   (C)   (D)
TAT 6.3 6.6 7.3 None
WT 4.3 4.6 2.3  
Solution : gantt sol 2
P.No AT BT TAT=CT-AT WT=TAT-BT
1 0 4 16 12
2 1 3 5 0
3 2 1 7 4
4 3 2 1 0
5 4 5 8 6
      13 7
      AVG=50/6=8.3 Avg=29/6=4.8
  Question 3 :  If the AT of the processor are matching then schedule the process which is having lowest PID. TAT=? WT=?
P No. AT BT
1 5 3
2 7 1
3 6 2
4 1 1
5 1 2
6 8 3
Solution : gantt sol 3
P No. AT BT TAT WT
1 5 3 3 0
2 7 1 4 3
3 6 2 4 2
4 1 1 1 0
5 1 2 3 1
6 8 3 6 3
  Question 4:
P No. AT BT
1 0 30
2 1 2
3 2 2

P No. AT BT
1 0 30
2 1 2
3 2 2
  Solution: gantt sol 4 If the First process is CPU bound process, then, avg waiting time of all other process is very big. This effect is called CONVOY EFFECT]]>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top