The following processes are being scheduled using a preempti
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 identied 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 turn around time for each process?
c. What is the waiting time for each process?
d. What is the CPU utilizationrate?
| Thread | Priority | Burst | Arrival |
| P1 | 40 | 20 | 0 |
| P2 | 30 | 25 | 25 |
| P3 | 30 | 25 | 30 |
| P4 | 35 | 15 | 60 |
| P5 | 5 | 10 | 100 |
| P6 | 10 | 10 | 105 |
Solution
a)
Number with thread name is start time.
0-P1
10-P1
20-Pidle
25-P2
35-P3
45-P2
55-P3
60-P4
70-P4
75-P2
80-P3
90-Pidle
100-P5
105-P6
115-P5
120- end
b)
P1: 20-0 = 20
P2: 80-25 = 55
P3: 90 - 30 = 60
P4: 75-60 = 15
P5: 120-100 = 20
P6: 115-105 = 10
c)
P1: 0
P2: 40
P3: 35
P4: 0
P5: 10
P6: 0
d.
105/120 = 87.5 percent

