/**/ /* this big loop does it all... goes thru once per time unit */ time = 0; while (!Done()) { /**/ /* add arrivals to readyq */ /**/ /* if I/O is finished, remove off I/o and put on readyQ */ /**/ /* if burst is finished, remove off cpu and put on I/O or finished */ /**/ /* if we are doing a feedback algorithm, potentially reduce the feedback priority of currently-executing process */ /**/ /* check for preemption */ /**/ /* dispatch if cpu is idle */ /**/ /* 'io-dispatch' if io is idle */ /**/ /* execute one cycle on cpu */ /**/ /* do one io cycle */ /**/ /* ok, now ready to go to next time unit! YEEHAW!!!! */ time++; }