Recent Post

Example of Non-Preemptive (SJF)

Question 1)

Process No.             AT             BT
      1                          1                7
      2                          2                5
      3                          3                1
      4                          4                2
      5                          5                8
       
Solution:-

                 Criteria :- Burst Time
                Mode :- Non-Preemptive 


  
 Here, 0 to 1 is idle state because Arrival time is stated from 1 then processes P1 is Arrival time is 1.

Processes P1 burst time is 7 then completion time is 1+7=8

then next processes P3 is execute because P3 burst time is 1 and P2 burst time is 5 then P3 burst time is less then P2 firstly P3 is execute.

Same here next P4 is execute  because P4 burst time is less then P2.

then next, P2 is complete because P5 burst time is more then P2

Finally P5 is Execute.

Next find out completion time (CT) , turn around time (TAT) , waiting time (WT) and AWT (Average Waiting Time).

CT (P1) :- 8
      (P2) :- 16
      (P3) :- 9
      (P4) :- 11
      (P5) :- 24

TAT(Turn Around Time) :-
                Formula :--   TAT = CT - AT

TAT(P1) :-8 - 1 =7
       (P2) :-16 - 2 = 14
       (P3) :- 9 - 3 = 6 
       (P4) :- 11 - 4 = 7
       (P5) :- 24 - 5 = 19

ATAT = 7+14+6+7+19/5  = 53/5  = 10.6

WT(Waiting Time) :-
                Formula :-- WT = TAT - BT

WT(P1) :-7 - 7 = 0
      (P2) :- 14 - 5 = 9
      (P3) :- 6 - 1 = 5
      (P4) :- 7 - 2 = 5
      (P5) :- 19 - 8 = 11        

AWT = 0+9+5+5+11/5   = 30/5 = 6

No comments