From owner-freebsd-hackers Thu Mar 13 9: 5:53 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E60F37B401 for ; Thu, 13 Mar 2003 09:05:52 -0800 (PST) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0E9A43FBD for ; Thu, 13 Mar 2003 09:05:50 -0800 (PST) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.fraunhofer.de (8.11.6/8.11.6) with ESMTP id h2DH5WM11226; Thu, 13 Mar 2003 18:05:32 +0100 (MET) Date: Thu, 13 Mar 2003 18:05:32 +0100 (CET) From: Harti Brandt To: Enache Adrian Cc: Peter Jeremy , David Cuthbert , hackers@FreeBSD.ORG Subject: Re: first parameter to select In-Reply-To: <20030313165018.GA703@ratsnest.hole> Message-ID: <20030313175543.E641@beagle.fokus.fraunhofer.de> References: <3E702BCC.3030208@kanga.org> <20030313083710.GA8225@cirb503493.alcatel.com.au> <20030313165018.GA703@ratsnest.hole> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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