"Jacob Read" <23*7*9*
6@s*u*e*t*u*a*e*u*a*> wrote:
> I have some questions about the sample solution for myscheduler. When sleeping a specific process, it doesn't seem to take into account the 10 microseconds required to move the process from running into blocked, before sleeping. Should we also not account for this?
A process asking to sleep for some time, is asking for that time on 'the clock on the wall'. If it makes the request to sleep for 10 seconds at time=3 seconds, it expects to be awoken at 13 seconds (but can't expect to run at exactly 13 seconds). The processes doesn't care what else is happening while it is sleeping, such as being moved between states.
> Also, I don't understand where the project is gaining the extra 2 microseconds from (this is using the standard example sysconfig and commands list). Like it can go from 1 to 5 to first go into the running state, and then takes 10 microseconds to execute the sleeping syscall, which would be 16-25, right? For example, my version of the project would give measurements of 1000080 0. Because it would add 10 microseconds because of moving the running process into blocked, but it wouldn't have the additional 2 microseconds.
I'm unsure what you're comparing these values with/from, but please lease use the web-based sample solution, rather than the Workshop 5 recording, for comparison purposes.