There are 3 programs running on the computer:
- foo, which has just moved onto the CPU, and needs
a total of 170ms of CPU time.
- blah, which is on the ready queue, and needs a total
of 90ms of CPU time.
- hink, which is on the ready queue, and needs a total
of 40ms of CPU time.
- murg, which is blocked waiting for an IO service that
will be completed in another 60ms. Once the IO service is
completed murg needs another 30ms of CPU time.
Using round-robin scheduling, with a quantum of 50ms, show each change
to which process is using the CPU and the state of the ready queue,
until all processes are completed. Assume that the time taken for the OS
to respond to interrupts is 0. Here's the end of things ...
Time 0 50 60 100 140
CPU: foo blah blah hink foo
RQ : blah<-hink hink<-foo hink<-foo<-murg foo<-murg<-blah murg<-blah
IOQ: murg murg
Time 190 220 260 310 330
CPU: murg blah foo foo
RQ : blah<-foo foo