From owner-freebsd-hackers Mon Dec 9 15:06:08 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id PAA08293 for hackers-outgoing; Mon, 9 Dec 1996 15:06:08 -0800 (PST) Received: from chai.plexuscom.com (chai.plexuscom.com [207.87.46.100]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id PAA08287 for ; Mon, 9 Dec 1996 15:06:03 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by chai.plexuscom.com (8.7.6/8.6.12) with SMTP id SAA01955; Mon, 9 Dec 1996 18:05:53 -0500 (EST) Message-Id: <199612092305.SAA01955@chai.plexuscom.com> X-Authentication-Warning: chai.plexuscom.com: Host localhost [127.0.0.1] didn't use HELO protocol To: John Birrell Cc: hackers@freebsd.org Subject: Re: poll(2) In-reply-to: Your message of "Tue, 10 Dec 1996 08:18:03 +1100." <199612092118.IAA10527@freebsd1.cimlogic.com.au> Date: Mon, 09 Dec 1996 18:05:53 -0500 From: Bakul Shah Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > There are a few things that NetBSD has added recently that belong (IMHO) > in FreeBSD too. One of them is poll(2), which gives an alternative to > select(2) that does not suffer from the FD_SETSIZE "feature". Note that the 2.2 kernel does not have this limitation (kern/sys_generic.c:select() allocates space as necessary for the three bitstrings). You can compile user programs with FD_SETSIZE different from the default of 256. You can even use different size bitstrings in the same program in different select() calls but you have to cast fd_mask* to fd_set* There are other reasons why poll() can be preferable to select(): - it does not overwrite the input arguments - it is more efficient when the fd set being tested is a small subset of the total fds in use. - fds are not serviced from the lowest numbered fd to the highest. (servicing by the increasing fd number implicitly favors the lower numbered fds.) - more conditions per fd can be tested.