We divide I/O into serial I/O and parallel I/O according to the execution method. After the serial I/O is completed, the next I/O will be executed. Parallel I/O is more complex, but it is easier to understand that several I/O operations are performed simultaneously. One thing to note is that in serial I/O, requests are generally executed in the order of request queues and results are returned in this order. The results returned by parallel I/O are not in any order. Serial I/O and parallel I/O can work in combination. For example, multiple groups of parallel I/O exist, and each group contains different numbers of serial I/O.
In node, we assume that all I/O delays are infinite, and they may execute 0 to infinite time. We do not know or assume their specific execution duration. Instead of waiting for their execution to complete, we should use the event-based mode. When I/O execution is complete, we should use the callback function to respond to the results. Therefore, using parallel I/O is an ideal solution. We can execute multiple requests and return results in the order they have been executed.
So we now have two ways to process I/O: sequential serial processing and non-sequential parallel processing. Sequential parallel processing is also a useful mode. This method can be used when I/O is allowed to run in parallel and the original sequence is used to return results. Non-sequential serialization does not benefit, so we will not discuss it.
Note:
I felt like I was familiar with this part. I used to learn how to run the operating system and how to implement multi-threaded programming. If you are familiar with the knowledge, it is certainly easier to understand this knowledge.