Step 1: Identify the optimal scheduling policy.
When CPU burst times are known in advance, the Shortest Job First (SJF) scheduling policy minimizes average waiting time.
Step 2: Order the processes by CPU burst time.
The burst times in ascending order are:
\[
10 \text{ ms}, \; 16 \text{ ms}, \; 20 \text{ ms}
\]
Step 3: Compute waiting times.
- Process with 10 ms burst: waiting time \( = 0 \) ms
- Process with 16 ms burst: waiting time \( = 10 \) ms
- Process with 20 ms burst: waiting time \( = 10 + 16 = 26 \) ms
Step 4: Calculate the average waiting time.
\[
\text{Average waiting time} = \frac{0 + 10 + 26}{3} = \frac{36}{3} = 12
\]
% Final Answer
Final Answer: \[ \boxed{12} \]
int main () {
int i;
for (i = 0; i < 3; i++){
if (fork() == 0){
continue;
}
break;
}
printf("Hello!");
return 0;
}