Sorry if my explanations are terrible. Let me try again and be more clear this time. Say at 50usecs, there is a process running on the CPU. A sleeping process and an I/O process are both set to unblock at 50usecs (e.g. the sleeping process was put to sleep at 40usecs and set to sleep for 10usecs, and the I/O process started at 20usecs, took 20usecs to acquire the databus, and 10usecs to complete the R/W operation).
Do we follow the order here and unblock the sleeping process first?
>unblock any sleeping processes
>unblock any processes waiting for all their spawned processes (children) to terminate
>unblock any completed I/O
>commence any pending I/O
>commence/resume the next READY process
>otherwise the CPU remains idle...
Or do we unblock the I/O process first (from the clarifications) as the I/O process was the first one to request its action?
>If multiple processes can be unblocked at any time, they are unblocked (added to the READY queue) in the same order that they requested their action.