Computer Science, asked by agarwalnishant9622, 1 year ago

Consider n processes sharing the cpu in a round-robin fashion. Assuming that each process switch takes s seconds, what must be the quantum size q such that the overhead resulting from process switching is minimized but, at the same time, each process is guaranteed to get its turn at the cpu at least every t seconds ?

Answers

Answered by hulk9387
0

Every process will get CPU for ( q) seconds and each process wants CPU again after t seconds.

Thus, there will be (n-1) processes once after current process gets CPU again. Each process takes s seconds for context switch.

Hence

(Qp1)(s)(Qp2)(s)(Qp3)(s)(Qp1)

It can be seen that since P1 left and arrived again, there have been n context switches and (n-1) processes. Thus, equation will be:

q*(n-1) + n*s


hulk9387: ₹hello
Similar questions