Click to See Complete Forum and Search --> : Prioritizing


Hena
08-21-2001, 02:12 AM
Is there any way to prioritize applications on Linux? So that i could give some programs more calculating power than others, not depending (perhaps) from the time/user who implements it.

How is done anyways on Linux, even for all programs or something?

Malakin
08-21-2001, 04:28 AM
If you're using KDE, just run KPM, right click on a process and you can renice it, lower values are higher priority.

From the command line you can use renice.
"renice -8 -p" where p is the programs pid, find the pid with "ps aux" or "ps aux | grep program" substitute program for the name of whatever you're looking for.

If you want to start something off at a certain nice level you can use this command
"nice -n 8 program" and this would set program to a level of 8.

Hena
08-21-2001, 06:12 AM
Well KPM seems allows me to change it manually for every current running program. But what i'd like is to have that done automatically after some settings i've chosen in advance for the programs. I rather wouldn't start doing script files for all the programs that would need this priorizing.

Malakin
08-21-2001, 06:36 AM
If you're running your programs from icons in KDE - right click->properties->execute and at the command line put in your nice command "nice -n -6 myprogram"

If you're running them command line you will have to write a short script for them or type the nice command every time.

If the program you want to nice is called myprogram just rename it to myprogram1, then make a file with the following contents:

#!/bin/sh
nice -n -6 myprogram1

save the file as myprogram. make it executable "chmod +x myprogram" and now whenever you run it, it will automatically be nice'd.

Edit: I've never had any problems with the default process scheduling. If you really feel the need to use nice I can't see it being for any more then a few programs.

[ 21 August 2001: Message edited by: idealego ]