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

Suppose that the following processes arrive for execution at the times indicated

ID: 3747410 • Letter: S

Question

Suppose that the following processes arrive for execution at the times indicated. Each process will run for the amount of time listed. In answering the questions, use non-preemptive scheduling, and base all decisions on the information you have at the time the decision must be made.

Process Arrival Time Burst Time Priority level Size of job

P1 0.0 8 3 15k

P2 0.4 4 2 10k

P3 1.0 1 1 25k

Calculate the average turnaround time and produce the Gantt charts for these processes using the following dispatch algorithms i. Round robin with quantum of 2 secs

ii Strict Priority

iii. Shortest Remaining time First

Explanation / Answer

(i) Using round robin algorithm with quantum of 2 sec,

Queue: P1, P2, P3, P1, P2, P1, P1

0                2                   4              5                7                 9               11             13

Average Completion time = ( 13 + 9 + 5 )/3 = 9 sec

Average Arrival time = (0 + 0.4 + 1.0 )/3 = 1.4/3 = 0.467 sec

Average turnaround time = Average completion time - Average Arrival time = 9 - 0.467 = 8.533 sec

(ii) Given, strict priority and Non-preemption :

Assume, Priority with low value has highest priority.

0               8               9               13

Avg completion time = ( 13 + 9 + 8)/3 = 10 sec

Avg arrival time = (0 + 0.4 + 1.0)/3 = 1.4/3 = 0.467 sec

Avg turnaround time = avg completion time - avg arrival time = 10 - 0.467 = 9.533 sec

(iii) Using SRTF,

                                              

0             0.4           1               2           5.4            13

Since, completion time of P1 = 13, P2 = 5.4, P3 = 2 ,      so

Average completion time = ( 13 + 5.4 + 2) / 3 = 20.4 / 3 = 6.8 sec

Average Arrival time = (0.0 + 0.4 + 1.0) / 3 = 0.467 sec

Average turnaround time = 6.8 - 0.467 = 6.333 sec

P1 P2 P3 P1 P2 P1 P1
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote