select() starvation?

Russ Allbery rra at stanford.edu
Sat Feb 3 00:43:17 UTC 2001


Jaye Mathisen <mrcpu at internetcds.com> writes:

> So I'm wondering if when innd does the select() and gets the list of
> fd's waiting to be read, does it just empty the first one, then go back
> to select?  or does it process all the fd's that came back as ready, and
> then go back into select.

> Cause the first option kind of explains what I was seeing, the 2nd, I
> shouldn't be seeing it.

It goes through all of them, unless it has data on the control connection
or on the local NNTP channel, in which case it only looks at the first
three so as to prioritize those channels.

There used to be a separate problem with innd (or at least I think it may
be a problem) where it used the same sized buffer to read from connections
when it was expecting commands from when it was expecting articles and did
this because it was using the read size to prevent starvation by only
processing X commands at a time from each channel.  I think this is really
the wrong approach, and particularly when accepting binaries you want to
suck down as much as you can at a time to save on system calls.  It's not
really going to save anything to do it later rather than do it right away.

I haven't had a chance to digest Katsuhiro's recent changes yet, though,
and I'm not sure if he changed this (I see that there were a bunch of
modifications in that region of the code).

You may want to try CURRENT if you're in a position to test and see if the
new changes make this any better.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-workers mailing list