459 views
1 votes
1 votes
Consider two processes $P_1$ and $P_2$ each of which needs exactly one CPU burst. The duration of the CPU bursts are 10 ms and 20 ms for $P_1$ and $P_2$ respectively. Assume that the processes are scheduled using a round-robin scheme with a time-slice of $t$ ms, a context switch takes 5ms, and it takes negligible time to run the scheduling algorithm. If $P_1$ and $P_2$ are equally likely to get the first time-slice, calculate the value of $t$ so that the average turnaround time for $P_1$ and $P_2$ is minimized.

1 Answer

1 votes
1 votes
20

To Minimise TAT we have to reduce number of context switch ,so choose time slice in such way that we minimum number of context switch.if ts=20 schedule seqeunce is p1p2 or p2p1 whatever number of context switch =1

now question arises why not 10?simple answer is both process is equal like to schedule.if choose p2 and ts=10 then schedule sequnce like p2,p1,p2 hence number context switch =2

Related questions

0 votes
0 votes
3 answers
1