From owner-freebsd-hackers Fri Jul 2 22: 2:28 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from janus.syracuse.net (janus.syracuse.net [205.232.47.15]) by hub.freebsd.org (Postfix) with ESMTP id 2441414C7F for ; Fri, 2 Jul 1999 22:02:22 -0700 (PDT) (envelope-from green@unixhelp.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.2/8.8.7) with ESMTP id BAA22495; Sat, 3 Jul 1999 01:01:08 -0400 (EDT) Date: Sat, 3 Jul 1999 01:01:07 -0400 (EDT) From: "Brian F. Feldman" X-Sender: green@janus.syracuse.net To: Jonathan Lemon Cc: wayne@crb-web.com, hackers@FreeBSD.ORG Subject: Re: poll() vs select() In-Reply-To: <199907030427.XAA17423@free.pcs> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 2 Jul 1999, Jonathan Lemon wrote: > In article you write: > >now supports the select() and poll() system calls. My question is really one > >of usage. Why would one us poll() over select()? Is select eventually going > >to go away for some reason? > > select() as a user-level call will never go away; there is a large base > of code that uses it. > > 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. > > 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(). > > -- > Jonathan > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Brian Fundakowski Feldman _ __ ___ ____ ___ ___ ___ green@FreeBSD.org _ __ ___ | _ ) __| \ FreeBSD: The Power to Serve! _ __ | _ \._ \ |) | http://www.FreeBSD.org/ _ |___/___/___/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message