Date: Thu, 13 Mar 2003 18:05:32 +0100 (CET) From: Harti Brandt <brandt@fokus.fraunhofer.de> To: Enache Adrian <enache@rdslink.ro> Cc: Peter Jeremy <peterjeremy@optushome.com.au>, David Cuthbert <dacut@kanga.org>, hackers@FreeBSD.ORG Subject: Re: first parameter to select Message-ID: <20030313175543.E641@beagle.fokus.fraunhofer.de> In-Reply-To: <20030313165018.GA703@ratsnest.hole> References: <3E702BCC.3030208@kanga.org> <20030313083710.GA8225@cirb503493.alcatel.com.au> <20030313165018.GA703@ratsnest.hole>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 13 Mar 2003, Enache Adrian wrote: EA>On Thu, Mar 13, 2003 at 07:37:10PM +1100, Peter Jeremy wrote: EA>> On Thu, Mar 13, 2003 at 01:57:16AM -0500, David Cuthbert wrote: EA>> >To be honest, I've never passed anything but FD_SETSIZE for this EA>> >parameter. When I'm writing a performance critical server, I use poll() EA>> >instead. It's faster EA>> EA>> This is an interesting claim. Do you have some pointers to back it up? EA>> It would seem to be rather unreasonable to claim that poll() is faster EA>> when (by your own admission) you've never used select() efficiently. EA>> I could equally say that I always pass getdtablesize() as the second EA>> argument of poll() and if I'm writing a performance-critical server, EA>> I use select() instead - it's faster. EA> EA>I have no benchmarks, but judging after the way things are implemented EA>in the FreeBSD kernel, select() is definitely faster. EA> EA>Please someone explain me what is meant in select(2) by: EA> EA> If nfds is greater than the number of open files, select() is not guaran- EA> teed to examine the unused file descriptors. For historical reasons, EA> select() will always examine the first 256 descriptors. EA> EA>Should it be that select() examines also _closed_ file descriptors which EA>are in the bitmaps ( closed_fd < nfds && closed_fd < 256 ) ? Isn't that what the EBADF return is for? EA>(Of course, it won't do that :)) harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org 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?20030313175543.E641>