Loading

Before Tomcat EndPoint: I/O Models

Before Tomcat EndPoint: I/O Models

When an user thread launchs an I/O operation, it would have to experience two steps to get the network data.

  • The user thread wait for the OS kernel copy the data from the network interface to the kernel space.
  • The OS kernel copy the data from the kernel space to the user space.

image-20210312230501619

To complete the two steps, smart people proposed some I/O models. Follow these models, we can get the data from network.

There are five I/O models in Unix: blocking I/O, nonblocking I/O, I/O multiplexing (select and poll), signal driven I/O (SIGIO), asynchronous I/O (the POSIX aio_functions).

Blocking I/O Model

image-20210312233954181

image-20210312234021113

Nonblocking I/O Model

image-20210312234155895

image-20210312234108418

I/O Multiplexing Model

image-20210312234306285

image-20210312234447270

Signal-Driven I/O Model

image-20210312234739206

Asynchronous I/O Model

image-20210312234752073

image-20210312234825890

posted @ 2021-03-13 00:29  齐玉  阅读(66)  评论(0)    收藏  举报