Process Scheduling Numericals for Practice
FCFS
P1: Arrival Time = 2, Burst Time = 6
P2: Arrival Time = 5, Burst Time = 2
P3: Arrival Time = 1, Burst Time = 8
P4: Arrival Time = 0, Burst Time = 3
P5: Arrival Time = 4, Burst Time = 4
Determine the order of completion, and calculate the average response time, waiting time, and turnaround time for these processes under FCFS scheduling. Draw the corresponding Gantt chart.
SJF (Non-preemptive)
P1: Arrival Time = 3, Burst Time = 4
P2: Arrival Time = 2, Burst Time = 6
P3: Arrival Time = 1, Burst Time = 5
P4: Arrival Time = 0, Burst Time = 9
P5: Arrival Time = 4, Burst Time = 2
Determine the execution order using SJF (non-preemptive) scheduling, and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart.
SRTN (preemptive)
P1: Arrival Time = 2, Burst Time = 3
P2: Arrival Time = 1, Burst Time = 6
P3: Arrival Time = 4, Burst Time = 4
P4: Arrival Time = 6, Burst Time = 5
P5: Arrival Time = 5, Burst Time = 2
Determine the execution order using SRTN scheduling, and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart, considering process preemption.
Priority (non-preemptive)
P1: Arrival Time = 1, Burst Time = 4, Priority = 2
P2: Arrival Time = 3, Burst Time = 6, Priority = 1
P3: Arrival Time = 5, Burst Time = 5, Priority = 3
P4: Arrival Time = 0, Burst Time = 3, Priority = 4
P5: Arrival Time = 2, Burst Time = 2, Priority = 5
Task: Determine the execution order using Priority Scheduling (non-preemptive), and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart.
Priority (preemptive)
P1: Arrival Time = 0, Burst Time = 8, Priority = 3
P2: Arrival Time = 2, Burst Time = 5, Priority = 1
P3: Arrival Time = 4, Burst Time = 3, Priority = 4
P4: Arrival Time = 6, Burst Time = 6, Priority = 2
P5: Arrival Time = 7, Burst Time = 2, Priority = 1
Determine the execution order using Priority Scheduling (preemptive), and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart, including the points of preemption.
Round-robin (time quantum = 2)
P1: Arrival Time = 0, Burst Time = 4
P2: Arrival Time = 1, Burst Time = 5
P3: Arrival Time = 2, Burst Time = 7
P4: Arrival Time = 3, Burst Time = 2
P5: Arrival Time = 4, Burst Time = 1
Determine the execution order using Round Robin scheduling with a time quantum of 2, and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart. Find the total number of context switches (the change of the processor state from idle to running amounts to one context switch too, the processor is idle before the first process arives and goes back to idle after that last process terminates).