Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2002 03:54:22 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Peter Leftwich <Hostmaster@Video2Video.Com>
Cc:        FreeBSD Questions <FreeBSD-Questions@FreeBSD.Org>
Subject:   Re: man top
Message-ID:  <20020404015422.GA71893@student.uu.se>
In-Reply-To: <20020403174013.W1728-100000@66-75-1-142.san.rr.com>
References:  <20020403174013.W1728-100000@66-75-1-142.san.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020404015422.GA71893>