I am just curious about the implementation of the FD macros and
select function in UNIX systems.
The select call returns the number of fds set in the fd_set
specified in the call. Wouldnt it be more useful to the application if
it got an array of fds that are ready. This will be useful when I am
using select with many descriptors. Right now the flow of a program
waiting to read on 100 descriptors will be like.
1) Add the 100 descriptors to the read fd_set.
2) Call select.
3) Call FD_ISSET on 100 descriptors to see if they are set. (This is
the worst estimate).
If on the other hand select returned an array of set descriptors the
steps would be
1) Add 100 descriptors to the read fd_set
2) Call select
3) Use the return value of select.
Any comments will be welcome. Just trying to understand the design of
the internals of the UNIX os.
Chinmay V. P.
Sent via Deja.com http://www.deja.com/
Before you buy.