Re: Timings for optimised poll(2) (fwd)

Jim Nance (jlnance@avanticorp.com)
Wed, 27 Aug 1997 09:11:52 -0400 (EDT)


Forwarded message:

> Hm. Perhaps a simple and cheap alternative is to use find_first_bit on
> each fd_set, then take the minimum index of the three, and start
> normal scanning from there. Of course, it won't help in the case where
> you are selecting on descriptors 100,200,300,400,500,600,700,800,900
> or some other such sparse set.

One thing I have been thinking about since this thread appeared is
having the application rearange the contents of the pollfd[] array in
response to the results of the last call to poll(). If you know some
statistics about the application it might be possible get all the
active connections moved to the front of the array, which would allow
you to bail out of the loop early. Whether this would help you or not
depends on your application though.

Jim