Tubetrue01 / articles

0 stars 0 forks source link

IO 多路复用(一) select 函数 | Tubetrue01 #3

Open Tubetrue01 opened 3 years ago

Tubetrue01 commented 3 years ago

https://tubetrue01.github.io/articles/2020/12/15/c_io/IO-%E5%A4%9A%E8%B7%AF%E5%A4%8D%E7%94%A8(%E4%B8%80)-select-%E5%87%BD%E6%95%B0/

引言 在介绍 IO 多路复用的时候,始终都会围绕 select、pselect、poll、epoll 这几个函数展开。为了对它们进行详细的说明,这里会分为几篇文章(避免篇幅过大)。 1.0 select 函数 select 是用于 I/O 多路复用的一个系统调用函数。在 C 程序中,该系统调用在 sys/select.h 或 unistd.h 中声明。它允许进程指示内核等待多个事件中的任何一个发