P1 3 2 0
P2 1 3 0
P3 2 2 0
P4 2 5 4
P5 1 3 4
P6 2 2 8
Queue: P2/P3/P1 (in order of priority)
Time 0
P2 runs
Queue: -/P3/P1
Time 3: P2 ends
run P3
Queue: -/-/P1
Time 4: 2 new jobs
Queue: P5/P4/P1
P3 swapped out
P5 runs
Queue: -/P4,P3/P1
P5 runs
Time 7: P5 ends
P4 runs
Queue: -/P3/P1
Time 8: P6 arrives
Queue: -/P3,P6/P1
P4 continues to run
Time 12: P4 terminates
P3 runs
Queue: -/P6/P1
Time 13: P3 terminates
P6 runs
Queue -/-/P1
Time 15: P6 terminates
P1 runs
Time 17: P1 terminates
no more jobs in queue
This is just one scenario. Many parameters depend on the algorithm. Some have promotion (like the P1 job), some would run till the time slice is up before switching, even if a higher priority job is waiting, etc.
Check the above scheduling against your detailed algorithm (time slice, promotion, etc.) and make necessary adjustments.
Process Management Exercise
Given the following data, prepare a Gantt Chart to a system based on priority andinterrupts ("preemptive"), where priority 1 is the highest and 3 is the lowest.
Process Priority Burst Time Tiempo de Llegada
P1 3 2 0
P2 1 3 0
P3 2 2 0
P4 2 5 4
P5 1 3 4
P6 2 2 8
1 answer