View previous topic :: View next topic |
Author |
Message |
jmckay123456789 n00b
Joined: 16 Aug 2003 Posts: 46
|
Posted: Thu Nov 20, 2003 5:25 am Post subject: changing priority with nice |
|
|
Just a question about how nice works. If I have a process with a value of 0 and another with a value of -1 obviously the latter will get priority. But assuming that no other process has a nice value lower than 0, will a value of -19 get even more priority over other processes? In other words, does the magnitude of the difference between different ranked processes matter, or only the fact that there is a difference?
thanks,
Cedar |
|
Back to top |
|
|
hadfield Retired Dev
Joined: 18 Mar 2003 Posts: 308 Location: Vancouver, BC, Canada
|
Posted: Thu Nov 20, 2003 10:32 pm Post subject: |
|
|
I'm quite certain (but could be wrong) that magnitude does matter. So if you run process A with -1 niceness and process B with 0 niceness, then perhaps the processes will take the following amount of time to finish:
A = 5 seconds
B = 6 seconds
But, if A is -19, then perhaps the processes will run in the following amount of time:
A = 2 seconds
B = 9 seconds.
These are just examples and don't represent reality. |
|
Back to top |
|
|
didl Retired Dev
Joined: 09 Sep 2003 Posts: 1106 Location: Pittsburgh, PA
|
Posted: Fri Nov 21, 2003 4:13 am Post subject: |
|
|
I guess the exact answer depends on the particular kind of scheduling
algorithm your kernel is using. Generally, there will likely never be
the situation that only processes A and B are running. Rather,
there will be a whole bunch of other processes running as well
and then the actual nice values - or the magnitude of the
difference of nice values between A and B if you so wish - will
matter. The nice values aren't the whole story though, the kernel
may take other things into consideration (e.g. the "interactivity"
of a job) to decide which processes to run when and how often. |
|
Back to top |
|
|
jmckay123456789 n00b
Joined: 16 Aug 2003 Posts: 46
|
Posted: Fri Nov 21, 2003 7:52 pm Post subject: |
|
|
great, thanks guys. It sounds like the take home message is that magnitude does matter.
best,
Cedar |
|
Back to top |
|
|
|