process - Multilevel feedback queue scheduling -


can please explain how draw gantt chart following using multilevel feedback queue scheduling

consider multilevel feedback queue scheduling 3 queues, numbered q1,q2,q3. scheduler first executes processes in q1, given time quantum of 10 milli-seconds. if process not finish within time, moved tail of q2.the scheduler executes processes in q2 when q1 empty. process @ head of q2 given quantum of 16 milli-seconds.if not complete, preempted , put q3. processes in q3 run on fcfs basis, when q1 , q2 empty.

 processes arrival time     burst time
p1 0 17
p2 12 25
p3 28 8
p4 36 32
p5 46 18

first of all, let's fix quantum time = 10 ms need implement multilevel feedback queue scheduling algorithm.

processes kept in ready queue! so, queue contain p1,p2,p3,p4,p5 in queue per time,but,feedback keep on sending lower queue if process crosses quantum time , hence, placed in lower queue,if left incomplete execution!

as given below, last times inclusive interval , starting times exclusive,but time-interval in between has considered :-

   1--->10 ms-------p1    10-->17 ms-------p1     // p1 finished execution..........    17-->20 ms-------p2       20-->30 ms-------p2     // p2 sent 1st lower queue it's still incomplete    30-->38 ms-------p3     // p3 finished execution..........    38-->40 ms-------p4    40-->50 ms-------p4     // pushed next p2 in 1st lower queue    50-->60 ms-------p5     // pushed next p4 in 1st lower queue 

now,1st lower queue comes in action time-quantum of 16 ms.

   60-->82 ms-------p2     // p2 finished execution.........    82-->98 ms-------p4     // p4 sent in 2nd lower queue it's still incomplete    99->107 ms-------p5     // p5 finished execution.......... 

now,2nd lower queue comes in action fcfs algorithm implementation.

 107-->111 ms-------p4     // finally, p4 finished execution.......... 

hence, gantt chart diagram time-quantum = 10 ms.

if you're left on doubt,please leave comment below!


Comments

Post a Comment

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

asp.net - Passing parameter to telerik popup -

node.js - ldapjs - write after end error -