On Thu, Mar 13, 2003 at 07:37:10PM +1100, Peter Jeremy wrote: > On Thu, Mar 13, 2003 at 01:57:16AM -0500, David Cuthbert wrote: > >To be honest, I've never passed anything but FD_SETSIZE for this > >parameter. When I'm writing a performance critical server, I use poll() > >instead. It's faster > > This is an interesting claim. Do you have some pointers to back it up? > It would seem to be rather unreasonable to claim that poll() is faster > when (by your own admission) you've never used select() efficiently. > I could equally say that I always pass getdtablesize() as the second > argument of poll() and if I'm writing a performance-critical server, > I use select() instead - it's faster.
I have no benchmarks, but judging after the way things are implemented in the FreeBSD kernel, select() is definitely faster. Please someone explain me what is meant in select(2) by: If nfds is greater than the number of open files, select() is not guaran- teed to examine the unused file descriptors. For historical reasons, select() will always examine the first 256 descriptors. Should it be that select() examines also _closed_ file descriptors which are in the bitmaps ( closed_fd < nfds && closed_fd < 256 ) ? (Of course, it won't do that :)) Regards Adi To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message