From owner-freebsd-questions Wed Apr 3 17:54:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from maild.telia.com (maild.telia.com [194.22.190.101]) by hub.freebsd.org (Postfix) with ESMTP id 9215837B405 for ; Wed, 3 Apr 2002 17:54:28 -0800 (PST) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by maild.telia.com (8.11.6/8.11.6) with ESMTP id g341sRo25669 for ; Thu, 4 Apr 2002 03:54:27 +0200 (CEST) Received: from falcon.midgard.homeip.net (h68n2fls20o913.telia.com [212.181.163.68]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id DAA15813 for ; Thu, 4 Apr 2002 03:54:26 +0200 (CEST) Received: (qmail 71912 invoked by uid 1001); 4 Apr 2002 01:54:23 -0000 Date: Thu, 4 Apr 2002 03:54:22 +0200 From: Erik Trulsson To: Peter Leftwich Cc: FreeBSD Questions Subject: Re: man top Message-ID: <20020404015422.GA71893@student.uu.se> Mail-Followup-To: Peter Leftwich , FreeBSD Questions References: <20020403174013.W1728-100000@66-75-1-142.san.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020403174013.W1728-100000@66-75-1-142.san.rr.com> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Apr 03, 2002 at 05:41:56PM -0800, Peter Leftwich wrote: > Why does the "top" command have a column for PRI *and* NICE? When I renice > a pid to, say, -15 or -19 to give it more CPU attention, the PRI stays at 2 > while the NICE column changes to the reniced value. > > Why is this? Thanks, this will be my last post today, I XGiveTheF_Up.bin, Because priority and nice-value are two different things. PRI is the actual priority that is used for cheduling the process. This is adjusted dynamically by the OS. Programs which use a lot of CPU usually gets gradually lowered priority. This is done so to ensure that the CPU is shared fairly between all processes. NICE determines how fast a programs priority will get lowered/increased. A program with a high nice-value will almost only get to run when no other process wants to run. (Although the OS guarantees that all processes will get at least some CPU time.) Processes with a low nice value will get to run more often. To sum it up: PRI determines which process will get to use the CPU at any given time (out of those processes wnating to use the CPU at that time.) NICE modifies how PRI is changed. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message