From owner-freebsd-hackers Thu Mar 13 8:51:50 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 F387B37B401 for ; Thu, 13 Mar 2003 08:51:48 -0800 (PST) Received: from mail.rdslink.ro (mail.rdslink.ro [193.231.236.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 3058B43FCB for ; Thu, 13 Mar 2003 08:51:47 -0800 (PST) (envelope-from enache@rdslink.ro) Received: (qmail 30063 invoked from network); 13 Mar 2003 16:52:40 -0000 Received: from unknown (HELO ratsnest.hole) (10.100.0.67) by mail.rdslink.ro with SMTP; 13 Mar 2003 16:52:40 -0000 Received: from ratsnest.hole (localhost [127.0.0.1]) by ratsnest.hole (8.12.5/8.12.5) with ESMTP id h2DGoIAi000711; Thu, 13 Mar 2003 18:50:18 +0200 Received: (from adi@localhost) by ratsnest.hole (8.12.5/8.12.5/Submit) id h2DGoIpO000709; Thu, 13 Mar 2003 18:50:18 +0200 Date: Thu, 13 Mar 2003 18:50:18 +0200 From: Enache Adrian To: Peter Jeremy Cc: David Cuthbert , hackers@FreeBSD.ORG Subject: Re: first parameter to select Message-ID: <20030313165018.GA703@ratsnest.hole> References: <3E702BCC.3030208@kanga.org> <20030313083710.GA8225@cirb503493.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030313083710.GA8225@cirb503493.alcatel.com.au> User-Agent: Mutt/1.4i 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, 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