什么民意调查()做的0超时? [英] What does poll() do with a timeout of 0?

查看:125
本文介绍了什么民意调查()做的0超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在看调查() 手册页 ,它告诉我,民调()时,正值和负值传递在超时参数。它不会不告诉我,如果超时是发生了什么 0 任何想法?

I'm looking at the poll() man page, and it tells me the behaviour of poll() when positive and negative values are passed in for the timeout parameter. It doesn't doesn't tell me what happens if timeout is 0. Any ideas?

综观 epoll_wait()手册页,它告诉我,以 0 ,它会立即返回,即使没有可用的事件。它是安全的假设,调查() 将行为相同的方式?

Looking at the epoll_wait() man page, it tells me that with a timeout value of 0, it will return right away, even if there are no events available. Is it safe to assume that poll() would behave the same way?

推荐答案

它会立即返回:

如果超时大于零,它指定一个最大时间间隔(毫秒)等待任何文件描述符准备就绪。如果超时值为零,那么调查()将返回而不阻塞。如果超时值为 1 调查无限期阻塞。

If timeout is greater than zero, it specifies a maximum interval (in milliseconds) to wait for any file descriptor to become ready. If timeout is zero, then poll() will return without blocking. If the value of timeout is -1, the poll blocks indefinitely.

,作为的Mac OS X 10.5 ;

最大时间间隔,以等待调查完成,以毫秒为单位。如果这个值是0,调查()将立即返回。如果此值 INFTIM(-1)调查()直到条件被发现会无限期地阻塞。

Maximum interval to wait for the poll to complete, in milliseconds. If this value is 0, poll() will return immediately. If this value is INFTIM (-1), poll() will block indefinitely until a condition is found.

,作为 OpenBSD的3.8

这篇关于什么民意调查()做的0超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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