[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About priority of processes.
On Sun, May 04, 2003 at 07:35:50AM -0700, Jose Luis Alarcon wrote:
> I am trying know the mechanism for asign the priority
> and who is the 'entity' that asign it. The developer of
> an aplication?, the developers of the kernel?, the cpu
> by itself?.
An application developer can place a task in a different scheduling
class with the sched_setscheduler(2) system call. An application
developer or user can coursely modify the priority of a task with the
nice(2) system call.
The kernel adjusts the priority over time, as a process consumes CPU
time. The general algorithm penalizes a task every time the task uses
its entire time quantum, and rewards a task when it voluntarily
relinquishes the cpu.
For details, see kernel/sched.c
--
You too can spend five years in prison; just distribute this program
once US Senator Hollings's CBDTPA bill is passed into law:
perl -e 'while(<>) { print;}'
PGP signature