In the picture attached, the Say that the system is running 3 jobs, A, B, and C, and that all of them are CPU-intensive (i.e., each one does one infinitely long CPU burst). The system begins with A on the CPU at the beginning its time quantum while B and C are in the Ready Queue, in that order. a) Show the execution pattern (as a string of A’s, B’s, C’, and o’s) assuming that the scheduler time quantum is equal to 4 ms. Show the execution for more than 20ms (but less than 30ms). b) In the long run (i.e, assuming jobs don’t ever terminate), what percentage of the CPU time is wasted doing context-switching/scheduling? The answers I came up with is as follows: a) AAAAoBBBoCCCoAAAoBBBoCCCoAAA, because for the first 4ms, A gets to execute it's full time quantum, however, when context-switching to the next job, the switch is included in the time quantum. b) 2.77% spent context switching, divide the number of o's by the total amount of runtime.
In the picture attached, the
Say that the system is running 3 jobs, A, B, and C, and that all of them are CPU-intensive (i.e., each one does one infinitely long CPU burst). The system begins with A on the CPU at the beginning its time quantum while B and C are in the Ready Queue, in that order.
a) Show the execution pattern (as a string of A’s, B’s, C’, and o’s) assuming that the scheduler time quantum is equal to 4 ms. Show the execution for more than 20ms (but less than 30ms).
b) In the long run (i.e, assuming jobs don’t ever terminate), what percentage of the CPU time is wasted doing context-switching/scheduling?
The answers I came up with is as follows:
a) AAAAoBBBoCCCoAAAoBBBoCCCoAAA, because for the first 4ms, A gets to execute it's full time quantum, however, when context-switching to the next job, the switch is included in the time quantum.
b) 2.77% spent context switching, divide the number of o's by the total amount of runtime.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps