Question:
The following processes are being scheduled using a preemptive, roundrobin
scheduling algorithm. Each process is assigned a numerical priority, with a higher
number indicating a higher relative priority. In addition to the processes listed
below, the system also has an idle task (which consumes no CPU resources and is
identified as Pidle ). This task has priority 0 and is scheduled whenever the system
has no other available processes to run. The length of a time quantum is 10 units. If
a process is preempted by a higher-priority process, the preempted process is
placed at the end of the queue.
a. Show the scheduling order of the processes using a Gantt chart.
b. What is the turnaround time for each process??
Step 1
Given:
The following processes are being scheduled using a preemptive, roundrobin
scheduling algorithm. Each process is assigned a numerical priority, with a higher
number indicating a higher relative priority. In addition to the processes listed
below, the system also has an idle task (which consumes no CPU resources and is
identified as Pidle ). This task has priority 0 and is scheduled whenever the system
has no other available processes to run. The length of a time quantum is 10 units. If
a process is preempted by a higher-priority process, the preempted process is
placed at the end of the queue.
a. Show the scheduling order of the processes using a Gantt chart.
b. What is the turnaround time for each process??
Step 2
Answer:
a. Show the scheduling order of the processes using a Gantt chart.
p1 | p2 | pidle | p2 | p3 | p2 | p3 | p4 | p2 | p3 | pidle | p5 | p6 | p5 |
0 10 20 25 35 45 55 60 75 80 90 100 105 115 120
b. What is the turnaround time for each process??
p1: 20-0 -20, p2: 80-25 = 55, p3: 90-30 = 60, p4: 75-60 = 15, p5: 120-100 = 20, p6: 115-105 = 10