From owner-freebsd-hackers Wed Dec 22 15:49:21 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from scam.xcf.berkeley.edu (scam.XCF.Berkeley.EDU [128.32.43.201]) by hub.freebsd.org (Postfix) with SMTP id CBC3214E42 for ; Wed, 22 Dec 1999 15:49:18 -0800 (PST) (envelope-from nordwick@scam.xcf.berkeley.edu) Received: (qmail 5771 invoked by uid 27268); 22 Dec 1999 23:48:53 -0000 Message-ID: <19991222234853.5770.qmail@scam.xcf.berkeley.edu> Date: Tue, 21 Dec 1999 15:55:18 PST To: Jonathan Lemon Cc: cmsedore@maxwell.syr.edu, hackers@FreeBSD.ORG From: Jason Nordwick Subject: Re: Practical limit for number of TCP connections? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5769.945906533.1@scam.XCF.Berkeley.EDU> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Return-Path: In-Reply-To: Your message of "Tue, 21 Dec 1999 09:22:04 CST." <199912211522.JAA04702@free.pcs> ---- >>In my case, load is reasonably distributed. Is poll() really that much >>better than select()? I thought that, excepting bit flag manipulations, >>it worked basically the same way on the kernel end. > >Yes, it is better. Select uses the same backend as poll(), but those >"bit flag manipulations" that you are talking about consume a measurable >amount of CPU time when you start throwing thousands of descriptors at it. >-- >Jonathan > I cannot believe that this is true. It would seem, to me, that it is highly dependant on the density of the interest bit vector of select(). If it is very dense, then select is more appropriate. Obviously, if you are only interested in fd# 5 and fd# 1000, then, yes, there is unecessary scanning. However is you are interested in 90% of the descriptors from 5 to 1000, then all the scanning is necessary. (you can also, obviously, look through 32 descriptors at a time). Also, doesn't the kernel need to copy the argument arrays into kernel space. A struct pollfd is 8 bytes per interested descriptor, whereas, select() only needs 1 bit per interested descriptor. If I am interested in 1000 descriptors (assuming in a row), that is 8000 bytes to copyin, versus 125 bytes. Can somebody who knows better explain, please? -jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message