Epoll on regular files

前端 未结 2 1619
[愿得一人]
[愿得一人] 2020-12-25 11:49

Can epoll (on Linux) be somehow useful for regular files? I know it\'s primarily used with sockets but just wonder.

2条回答
  •  旧巷少年郎
    2020-12-25 12:26

    Not really. epoll only makes sense for file descriptors which would normally exhibit blocking behavior on read/write, like pipes and sockets. Normal file descriptors will always either return a result or end-of-file more or less immediately, so epoll wouldn't do anything useful for them.

提交回复
热议问题