[comp.os.ms-windows.networking.* removed from followup list, since this
is now about POSIX and Unix APIs.]
In article <cu9a0c$2kt4$(E-Mail Removed)>,
(E-Mail Removed) (Vernon Schryver) writes:
> In article <barmar-(E-Mail Removed)>,
> Barry Margolin <(E-Mail Removed)> wrote:
>
> >> poll() can be used to get finer-grained information about the state
> >> of a particular file descriptor; select() can be used to get cruder
> >> information about a set of file descriptors.
> >
> >Poll() is also more efficient if there are lots of descriptors involved.
> >When select() returns, you have to search through all the descriptors
> >looking for the ones that became readable/writable, while poll() simply
> >returns the list of readable/writable descriptors.
>
> More than that, a classic BSD kernel implementation of select() involved
> sowakeup() to awakening all processes in the system stuck select() so
> that each process can search its bit masks for a descriptor that
> justifies returning to user mode.
Agreed. poll also doesn't suffer from select's FD_SETSIZE limit.
FD_SETSIZE can be changed at compile time, but that's inflexible and
wastes space if the app frequently only has a few descriptors in the
set. Or an app can maintain its own dynamically-sized FD_SETs, but
then the FD_* macros won't work. And overflowing FD_SETs was
recently documented as a security hole in a number of applications.
--
Michael Wojcik
(E-Mail Removed)
It does basically make you look fat and naked - but you see all this stuff.
-- Susan Hallowell, TSA Security Lab Director, on "backscatter" scanners