Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following is the SRT (Shortest Remaining Time) execution diagram given in th

ID: 3670713 • Letter: T

Question

The following is the SRT (Shortest Remaining Time) execution diagram given in the book for 6 processes PI through P6, that have the following CPU Burst times respectively: 135, 102, 56, 148, 125, 65. All processes except P6 arrive at 0ms, and P6 arrives at 200ms. Now you have 5 processes, P1 through P5, and they arrive at 1, 2, 4, 4 and 5 milliseconds respectively, and they have the following CPU Burst times respectively: 9, 8,3,10,4. For SRT scheduling, Calculate the total waiting time for every process Calculate the average waiting time for all processes. Assume negligible context switch time. Explain how priorities can be used in non-preemptive and preemptive scheduling; List two examples.

Explanation / Answer

1. Waiting Time:

P1 - 7, P2- 15, P3- 0, P4- 21, P5- 2

2. Average Waiting Time: 9

3. Tasks are usually assigned with priorities. At times it is necessary to run a certain task that has a higher priority before another task although it is running. Therefore, the running task is interrupted for some time and resumed later when the priority task has finished its execution. This is called preemptive scheduling.

Eg: Round robin

In non-preemptive scheduling, a running task is executed till completion. It cannot be interrupted.
Eg First In First Out

So, assigning priority make sense in case of preemptive.