107k views
5 votes
About n processes are time-sharing the CPU, each requiring T ms of CPU time to complete. The context switching overhead is S ms. (a) What should be the quantum size Q such that the gap between the end of one quantum and the start of the next quantum of any process does not exceed M ms? (b) For n = 5, S = 10, and M = 450, M = 90, M = 50, determine: The corresponding values of Q The percentage of CPU time wasted on context switching

User Thorn G
by
3.6k points

1 Answer

5 votes

Answer:

(a) Q = (M-(1-n)S)/n

(b)

When M = 450,

Q = 82

% CPU time wasted = 8.889%

When M = 90,

Q = 10

% CPU time wasted = 44.44%

When M = 50,

Q = 2

% CPU time wasted = 80%

Step-by-step explanation:

Given Data:

n = process

T = ms time

Context switch time overhead = S

and M is total overhead

See attached file for the calculation.

About n processes are time-sharing the CPU, each requiring T ms of CPU time to complete-example-1
About n processes are time-sharing the CPU, each requiring T ms of CPU time to complete-example-2
User Yousef Salimpour
by
3.8k points