From owner-freebsd-hackers Tue Aug 14 15:41:58 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from erasmus.off.net (erasmus.off.net [64.39.30.25]) by hub.freebsd.org (Postfix) with ESMTP id A237E37B405; Tue, 14 Aug 2001 15:41:55 -0700 (PDT) (envelope-from zab@erasmus.off.net) Received: by erasmus.off.net (Postfix, from userid 928) id E7F6D5FF66; Tue, 14 Aug 2001 22:41:56 +0000 (/etc/localtime) Date: Tue, 14 Aug 2001 18:41:56 -0400 From: Zach Brown To: Terry Lambert Cc: "Daniel M. Eischen" , Jonathan Chen , hackers@FreeBSD.ORG Subject: Re: pthreads and poll() Message-ID: <20010814184156.A4825@erasmus.off.net> References: <20010813120455.A63309@enterprise.spock.org> <3B780BFC.F2BA0A9B@vigrid.com> <3B79916D.FE1342E2@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <3B79916D.FE1342E2@mindspring.com>; from tlambert2@mindspring.com on Tue, Aug 14, 2001 at 02:00:29PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [pulls out his dead horse..] > > one thread would wake up. The mistake in your sample seems to be that > > you're having all threads block on the same fd. Why? > > Probably he has a bunch of daemons waiting around for work to > do (e.g. HTTP daemons all listening for connections to accept > on the same fd). Lot's of applications could use this model > to get a performance boost. I have yet to see a 'thundering accept()' actually shown to be a meaningful performance problem. Are there more than two significant situations here? a) you have lots of idle servers waiting for work on an fd. it arrives, they all wake up, only to find that one of them gets to do real work. Who cares? you were idle. you had time to kill. The time when this wouldn't be acceptable would be if there were _very_ tight response time constraints. b) you're under load. your servers are off doing work under that load. you rarely see a significant number of them waiting for new work at the same time. wakeups (or scheduling) don't make up a meaningful percentage of the real work (io, networking, app data crunching, etc) that is being done. "b)" was the case at the zdnet benchmarks, though people ran around screaming things about thundering accept()s apaches when not a one of them had profiling runs in front of them :) I'm not saying that wake-one isn't a fine idea, I just keep seeing references to the mystical thundering accept() wakeup problem and its solution that brings better performance. I keep asking when people mention it and no one has been able to show this to be the case based on numbers. Am I insane? - z To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message