epoll的定期文件 [英] Epoll on regular files

查看:124
本文介绍了epoll的定期文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否的epoll (在Linux上)是常规文件不知何故有用吗?我知道这主要与插座,但只是纳闷使用。

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

推荐答案

不是真的。 的epoll 才有意义,这通常表现出的读/写阻塞行为,如管道和套接字文件描述符。普通文件描述符总是要么返回一个结果或最终文件,或多或少立即让的epoll 不会为他们做任何有用的事情。

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.

这篇关于epoll的定期文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆