educative.io

Why does IO take 4 ticks when it's set to 5?

I have a question regarding the following command:

prompt> ./process-run.py -l 3:0 -L 5 -c
Time     PID: 0        CPU        IOs
  1  RUN:io-start          1
  2     WAITING                     1
  3     WAITING                     1
  4     WAITING                     1
  5     WAITING                     1
  6* RUN:io-start          1

Each I/O unit is set to 5 ticks to run, but why do they only have 4 rows in the results?

Hi,
Each process takes five ticks to process, as you can see in the snippet. The first process finishes execution on the 5th time unit, and the second starts on the 6th.
The four rows shown are when the CPU waits for the process to finish.

1 Like