[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: select()



At 01:32 AM 7/26/00 +0530, you wrote:
On Tue, Jul 25, 2000 at 12:49:18PM +0530, Kedar Patankar wrote:
> That is not so. When you declare an fd_set, there is no way to set its
> size. I haven't checked the size of it yet, but fd_set is implemented
> as an array of ints internally.
>

yeah... its implemented as an array of 1024 unsigned long ints. 1024 is the
FD_SETSIZE.

> The first argument is basically an optimization, to avoid having to look
> at all the bits in the fd_sets. An unfortunate side effect is that if you
> have only a few fds with big difference between their "integer" values,
> then the kernel ends up scanning a lot of "fd-space".
>

i like the poll behavior better... where u specify which fds to scan and it
scans those and returns on a state change. but poll is emulated thru select on
some old libc's ... ( < 5.4 ?)

Yeah its emulated for pre 2.1 kernels. What should i use ? ... poll seems to be much more convenient than select...