Date: Sat, 3 Jul 1999 08:39:35 -0500 From: Jonathan Lemon <jlemon@americantv.com> To: "Brian F. Feldman" <green@unixhelp.org> Cc: wayne@crb-web.com, hackers@FreeBSD.ORG Subject: Re: poll() vs select() Message-ID: <19990703083935.61252@right.PCS> In-Reply-To: <Pine.BSF.4.10.9907030058240.22384-100000@janus.syracuse.net>; from Brian F. Feldman on Jul 07, 1999 at 01:01:07AM -0400 References: <199907030427.XAA17423@free.pcs> <Pine.BSF.4.10.9907030058240.22384-100000@janus.syracuse.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990703083935.61252>