As we know, in Java there are 3 I/O modes: Block IO, Non-block IO, Async IO. The IO mode in programming language is actually underlying the OS level implementation.
In Linux(Unix) there are 5 IO modes:
- Blocking IO
- Nonblocking IO
- IO Multiplexing
- Signal driven IO
- Asynchronous IO
Before talk about the IO modes, let’s review the concept of IO. THe IO is short of Input/Output from CPU’s perspective: read/write data from local device (HDD, USB device…), remove device (the network). To simplify, let’s see the example that read/write a file from local HDD.
Blocking IO
![Blocking IO](/2019/08/16/5-I-O-Models-in-Linux/1.Blocking_IO.png)
Nonblocking IO
![Blocking IO](/2019/08/16/5-I-O-Models-in-Linux/2.Nonblocking_IO.png)
IO Multiplexing
![Blocking IO](/2019/08/16/5-I-O-Models-in-Linux/3.IO_Multiplexing.png)
Signal driven IO
![Blocking IO](/2019/08/16/5-I-O-Models-in-Linux/4.Signal_Driven_IO.png)
Asynchronous IO
![Blocking IO](/2019/08/16/5-I-O-Models-in-Linux/5.Asynchronous_IO.png)