API Design Matters | May 2009 | Communications of the ACM
Rohit Khare stashed this in Hacking
Stashed in: Software!
Yet another observation is that
Select() accepts a time-out value in microseconds: if no socket becomes ready within the specified time-out,
Select() returns. Note, however, that the function has a void return type—that is, it does not indicate on return whether any sockets are ready. To determine whether any sockets are ready, the caller must test the length of all three lists; no socket is ready only if all three lists have zero length.
Whenever you go down the stack of turtles, inevitably there's polling *somewhere*.