+
 新版

关于 epoll 的小小疑问, epoll 在等待事件的过程中会阻塞么

张为 发布于 2015/01/04 16:43
阅读 1K+
收藏 0

最近在看tornado的源码,有个RT的疑问

try:
    event_pairs = self._impl.poll(poll_timeout)
    except Exception as e:
    # Depending on python version and IOLoop implementation,
    # different exception types may be thrown and there are
    # two ways EINTR might be signaled:
    # * e.errno == errno.EINTR
    # * e.args is like (errno.EINTR, 'Interrupted system call')
        if errno_from_exception(e) == errno.EINTR:
            continue
        else:
            raise

在调用poll方法等待事件的过程中epoll是马上返回还是至少有一个事件后才返回。

加载中
0
osc_854744
osc_854744
nginx用这个阻塞做定时器
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部