From owner-freebsd-current@FreeBSD.ORG Fri Oct 27 23:16:45 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35C3616A407; Fri, 27 Oct 2006 23:16:45 +0000 (UTC) (envelope-from jd@ugcs.caltech.edu) Received: from riyal.ugcs.caltech.edu (riyal.ugcs.caltech.edu [131.215.176.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3618E43D69; Fri, 27 Oct 2006 23:16:43 +0000 (GMT) (envelope-from jd@ugcs.caltech.edu) Received: by riyal.ugcs.caltech.edu (Postfix, from userid 3640) id EEE4C45806; Fri, 27 Oct 2006 16:16:42 -0700 (PDT) Date: Fri, 27 Oct 2006 16:16:42 -0700 From: Paul Allen To: Julian Elischer Message-ID: <20061027231642.GJ30707@riyal.ugcs.caltech.edu> References: <917908193.20061027102647@serebryakov.spb.ru> <20061027103924.F79313@fledge.watson.org> <45426071.7020403@elischer.org> <602423478.20061028001449@serebryakov.spb.ru> <4542896D.1050001@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4542896D.1050001@elischer.org> Sender: jd@ugcs.caltech.edu Cc: Lev Serebryakov , Robert Watson , current@freebsd.org Subject: Re: KSE, libpthread & libthr: almost newbie question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2006 23:16:45 -0000 >From Julian Elischer , Fri, Oct 27, 2006 at 03:34:21PM -0700: > Lev Serebryakov wrote: > basically, if you and I both write programs to do a particular job > on a timesharing system, and you use threads to do so and I use > a sophisticated event handler/state machine, I shouldn't find that > my program is running like a pig because yours has 1000 slots in the > run queue and I only get run 1 in 1001 ticks. And if this hypothetical user with the 1000 threads instead uses 1000 processes we should just look the other way? Or worse we should encourage him to use processes instead of threads despite that the former ought to consume more wall-time because of the extra overhead? The answer to your situation is rlimits. Or put another way, absent such limits, if I can keep 1000 threads busy for the entire duration of your program, ipso facto I have more work to do than you do. I think what you are really saying is that you want an rlimit that allows WFQ by uid/gid/login classes. It isn't necessary for such a thing to run at the same frequency as the scheduler generally. Paul