A process $P_i$ is scheduled to a processor $M_k$, if the processor is free and no other process $P_j$ is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?
This problem involves calculating the average waiting time for four processes ($P_1, P_2, P_3, P_4$) scheduled on two processors ($M_1, M_2$) using a non-preemptive priority scheduling algorithm. All processes arrive at the same time (time 0).
We simulate the process execution step-by-step:
The waiting time for a process is the time elapsed from its arrival until it starts execution.
Waiting Time = Start Execution Time - Arrival Time
Since all processes arrive at time 0, the waiting time is simply the start time of execution.
The average waiting time is the sum of all waiting times divided by the number of processes.
Average Waiting Time = $\frac{W_{P1} + W_{P2} + W_{P3} + W_{P4}}{4}$
Average Waiting Time = $\frac{0 \text{ ms} + 0 \text{ ms} + 16 \text{ ms} + 20 \text{ ms}}{4}$
Average Waiting Time = $\frac{36 \text{ ms}}{4}$
Average Waiting Time = $9$ ms
Therefore, the average waiting time of the processes is 9 milliseconds.
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.