There are five I/O models in UNIX
- Block I/O model
- Non-blocking I/O model
- I/O multiplexing (select and poll)
- Signal-driven I/O
- Asynchronous I/O
1st types: blocking the I/O operation requested by the I/O model blocks the process until the I/O operation is completed. For example:
2nd types: non-blocking I/O models
When the request for I/O operations has to make the process blocking unable to complete, do not let the process blocking, but should return an error. For example:
3rd: I/O multiplexing Model
The call to select or poll is blocked on one of the two system calls, rather than the real I/O system calls. For example:
4th types: Signal-driven I/O models
Perform signal-driven processing on the I/O operation interface, and install a signal processing program by calling sigaction. The system calls are immediately returned, and the process continues to run, not blocking. When the data is ready, the sigio signal is generated. We can call the signal processing program at any time. For example:
5th types: asynchronous I/O models
Let the kernel start and notify us after the entire operation is completed. The main difference with the signal-driven I/O is that the signal-driven I/O is the kernel that notifies us when an I/O operation can be started, the asynchronous I/O model informs us when I/O operations are completed by the kernel. For example: