1. The read/write processes in the sample solution seem to be mostly fixed, however, the time to complete the read/write operation seems to be off by a multiple of 10. In the screenshot below, I am reading 10 Bytes from terminal which has a read speed of 10 Bytes/second. The read operation should take 1 second = 1 000 000 usecs, but the sample solution gives 10 000 000 usecs.
2. In an earlier post, you said that regardless of how long a process sleeps for, the first process that requests to sleep should also be the first process to be unblocked. E.g. if pid1 called sleep for 100usecs at time 10, and pid0 called sleep for 10usecs at time 30, then pid1 would still be unblocked first despite pid0 being ready to unblock at time 40.
Although you did say this, I do believe the sample solution is more correct. It wouldn't make sense to keep pid0 blocked just because another process called sleep earlier and for a longer time.