ANONYMOUS wrote:
> 1. I know we are allowed to print debugging statements, as long as the last line is the measurements line, however, I am a bit worried my program will be overwhelmed (like the sample solution) with large time periods (for example, the 1-second wait in the shortsleep command). In that case should I remove all my debug print statements, or will the time periods not be that extreme?
I'm not sure what you mean by 'my program will be overwhelmed'.
All output will be ignored except the last line, so it doesn't matter how much there is.
> 2. I also just wanted to clarify whether the correct order, when the CPU is idle, is to unblock (for example) a single finished sleeping process and then continue, or to unblock all finished sleeping processes and then continue? The clarifications say 'unblock any sleeping processes', while the sample solution simply unblocks one sleeping process and then continues - I'm guessing the sample solution is the correct way?
When the CPU is idle, at time T, is awakens *all* sleeping processes that should wake up at time T (or before); they are appended to the READY queue. That is what the sample does.