Jordi Espasa Clofent <jespasac@minibofh.org> wrote:
> I've realized that the nice(1) code hasn't been modified for a
long time
> (last code change seems from 4 years ago according the sources).
>
> ?Is the nice(1) behaviour the expected? I mean, ?Has been the ULE
> scheduler adapted to nice(1) command or not?
>
> nice(1) is a very old command based on old concepts and created in times
> when SMP didn't exist. So ?it works correctly when a modern an
> re-designed scheduler as ULE is used?
In fact nice is a very simple program. It only changes the
priority value of a process in a POSIX-compliant way.
There is no need to change or adapt it; it still works fine
in the SMP world and with new schedulers. It's up to the
scheduler to interpret and handle the priority values of
processes.
In other words: The nice(1) tool only attaches a number to
a process, nothing more. Only the scheduler knows what that
number means. So there's no need to change nice(1).
By the way, the source code of nice(1) is almost trivial.
Basically it just calls the setpriority(2) and execve(2)
syscalls. 99% of the source file consists of the BSD
license test, arguments parsing and C syntax overhead.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Gesch?ftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M?n-
chen, HRB 125758, Gesch?ftsf?hrer: Maik Bachmann, Olaf Erb, Ralf Gebhart
FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
"I have stopped reading Stephen King novels.
Now I just read C code instead."
-- Richard A. O'Keefe