4 ms·
> If there are no defined events then none of them has occurred. No no, all (certainly any!) of them occurred.
by duaneb 10y ago
> If there are no defined events then none of them has occurred.
No no, all (certainly any!) of them occurred.
- lmm 10y agoAll, but not any, and in fact none.
- Matthias247 10y agoYeah, it seems a little bit like arguing whether 0/0 is 0 or infinity without exact specification. While I would agree that the specification the poll case would favors sleeping I would still guess that it's pretty much undefined behavior as it's not a normal use-case to wait for nothing and would not rely on it. I don't see why a pure sleep behavior of poll would be wanted anyway, as it makes the eventloop unresponsive until the next timeout - which is normally not wanted in an eventdriven application. Normally I would always have at least one filedescriptor for eventloop wakeup (eventfd, signalfd, self-pipe, ...) in the poll set.
- JdeBP 10y agoWhen using ppoll() one can validly be waiting for (temporarily unmasked) signals alone.
- gpderetta 10y agoA pure sleep is exactly desirable when poll is coupled to a userspace timer queue. In this case you want to block until the next timer expires or the next io event, whatever come first. It is a fundamental building block of many event based applications.
- Matthias247 10y agoThat's totally right, forgot about that one. Probably used timerfd too much in the past :)