Re: >256 fd patch...

Theodore Y. Ts'o (tytso@MIT.EDU)
Fri, 21 Mar 1997 19:04:21 -0500


Date: Fri, 21 Mar 1997 14:41:32 -0800 (PST)
From: Darren Senn <sinster@scintilla.darkwater.com>

and 3) Poll for data.

While I agree that the large majority of code out there puts select() in its
top-level loop and uses methods 1 or 2, there is still quite a body of code
out there that uses the polling method at the very bottom of its innermost
loops.

This is still false optimization. If someone is polling for data, the
amount of time taken to do the context switch is *so* *large* that the
time to do the extra two comparisons is lost in the noise.

You can argue that this is a bad use of select(), or that those programmers
are hose-bags that clearly spend a great deal of time examining the insides
of their large intestines, and I might even agree with you. But I have
never seen a single select(2) man page that even implied that select() had
enough overhead as to render its use in an inner loop Evil(tm). So bad
use or not, you should expect that the code will be used that way.

It has nothing to do with select()'s interface as much as it has to do
with generic system call overhead. As far as your claim that there's a
quite a body of code that does it, what programs do this? They really
are quite broken.....

- Ted