Date: Thu, 13 Mar 2003 18:50:18 +0200 From: Enache Adrian <enache@rdslink.ro> To: Peter Jeremy <peterjeremy@optushome.com.au> Cc: David Cuthbert <dacut@kanga.org>, hackers@FreeBSD.ORG Subject: Re: first parameter to select Message-ID: <20030313165018.GA703@ratsnest.hole> In-Reply-To: <20030313083710.GA8225@cirb503493.alcatel.com.au> References: <3E702BCC.3030208@kanga.org> <20030313083710.GA8225@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030313165018.GA703>