From owner-freebsd-hackers Sat Jul 3 6:39:40 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from sumatra.americantv.com (sumatra.americantv.com [208.139.222.227]) by hub.freebsd.org (Postfix) with ESMTP id 8272114C2D for ; Sat, 3 Jul 1999 06:39:38 -0700 (PDT) (envelope-from jlemon@americantv.com) Received: from right.PCS (right.PCS [148.105.10.31]) by sumatra.americantv.com (8.8.5/8.8.5) with ESMTP id IAA26329; Sat, 3 Jul 1999 08:39:36 -0500 (CDT) Received: (from jlemon@localhost) by right.PCS (8.6.13/8.6.4) id IAA12641; Sat, 3 Jul 1999 08:39:35 -0500 Message-ID: <19990703083935.61252@right.PCS> Date: Sat, 3 Jul 1999 08:39:35 -0500 From: Jonathan Lemon To: "Brian F. Feldman" Cc: wayne@crb-web.com, hackers@FreeBSD.ORG Subject: Re: poll() vs select() References: <199907030427.XAA17423@free.pcs> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 In-Reply-To: ; from Brian F. Feldman on Jul 07, 1999 at 01:01:07AM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Jul 07, 1999 at 01:01:07AM -0400, Brian F. Feldman wrote: > On Fri, 2 Jul 1999, Jonathan Lemon wrote: > > poll() is faster (it doesn't have to do bit twiddling), and it's interface > > is cleaner (it can report invalid fd's, something select() can't do). As > > its functionality is a superset of select()'s, it is used as the internal > > implementation for select(). > > Actually, select() doesn't require horrendous amounts of copyin()s, which > poll() does. So have you benchmarked the two? I'd expect select to be faster. Yup, I have. poll() is faster; copying the parameters takes less time than bit twiddling. > > As for new code, use whichever you are comfortable with. Personally, I > > would recommend poll(), since it provides some added functionality over > > select() that makes for easier programming. > > poll() is a huge pain to use, which is why I recommend select(). Whichever you're comfortable with. poll() isn't a pain once you know how to use it, and it does bring additional benefits. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message