Process Burst Time Priority $P_1$ 10 3 $P_2$ 1 1 $P_3$ 2 4 $P_4$ 1 5 $P_5$ 5 2
This solution calculates the average waiting time for processes using non-preemptive priority scheduling. It assumes a lower numerical value indicates a higher priority.
| Process | CPU Burst Time (ms) | Priority | Arrival Time (ms) |
|---|---|---|---|
| P1 | 10 | 3 | 0 |
| P2 | 1 | 1 | 0 |
| P3 | 2 | 4 | 0 |
| P4 | 1 | 5 | 0 |
| P5 | 5 | 2 | 0 |
Processes are scheduled based on priority. Lower numbers mean higher priority. All arrive at time 0, so the execution order is determined solely by priority.
The non-preemptive execution sequence is: P2 → P5 → P1 → P3 → P4.
Waiting Time = Start Time - Arrival Time. Since all processes arrive at time 0, Waiting Time = Start Time.
| Process | Burst Time (ms) | Priority | Start Time (ms) | Waiting Time (ms) | Completion Time (ms) |
|---|---|---|---|---|---|
| P2 | 1 | 1 | 0 | 0 | 1 |
| P5 | 5 | 2 | 1 | 1 | 6 |
| P1 | 10 | 3 | 6 | 6 | 16 |
| P3 | 2 | 4 | 16 | 16 | 18 |
| P4 | 1 | 5 | 18 | 18 | 19 |
Sum the waiting times of all processes and divide by the total number of processes.
Assume that the following tasks are to be executed on a single processor system. All tasks have arrived at 0 msec.
| Job ID | CPU |
| a | 4 |
| b | 1 |
| c | 7 |
| d | 2 |
How long does it take for task "a" to complete if the scheduling time slice is a round-robin with 1 ms?
| Process | CPU Burst Time (MS) |
| P1 | 24 |
| P2 | 3 |
| P3 | 3 |
Consider the following table about processes, their burst time and arrival time
| Process | Burst Time | Arrival Time |
| P1 | 09 | 0 |
| P2 | 30 | 0 |
| P3 | 04 | 0 |
| P4 | 08 | 2 |
| P5 | 11 | 6 |
Now which of the process shall finish second last as per the respective GANTT charts for the non- preemptive SJF and Round Robin (time quantum = 10) scheduling methods.