edited by
1,424 views
2 votes
2 votes

Consider four processes all are arriving at time zero, with total execution time of 20, 10, 10 and 20 unit respectively. Each process spends the first 20% of execution time doing CPU, the next 60% of doing I/O computation and the last 20% of time doing CPU computation again. The operating system uses longest time first scheduling algorithm and schedules a new process either when running process get blocked I/O or when the running process finishes its CPU burst.
Assume that are I/O operations can be overlapped as much as possible. The average TAT of the system given by ______ unit.
[Note: When same burst occurs for multiple process high priority given to lowest process id] (upto one decimal place)

my ans is 16.5 but ans is given 24.5

edited by

1 Answer

Best answer
4 votes
4 votes

0---P1--4---P4---8----P2---10---P3---12----no process---16---P1---20---P4---24---P2---26---P3---28

At 16 P1 finishes it IO

At 20 P4 finishes it IO

At 16 P2 finishes it IO

At 18 P3 finishes it IO

Avg turnaround time=20+24+26+28/4=24.5

selected by
Answer:

Related questions