Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
changing priority with nice
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jmckay123456789
n00b
n00b


Joined: 16 Aug 2003
Posts: 46

PostPosted: Thu Nov 20, 2003 5:25 am    Post subject: changing priority with nice Reply with quote

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
View user's profile Send private message
hadfield
Retired Dev
Retired Dev


Joined: 18 Mar 2003
Posts: 308
Location: Vancouver, BC, Canada

PostPosted: Thu Nov 20, 2003 10:32 pm    Post subject: Reply with quote

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. :wink:
Back to top
View user's profile Send private message
didl
Retired Dev
Retired Dev


Joined: 09 Sep 2003
Posts: 1106
Location: Pittsburgh, PA

PostPosted: Fri Nov 21, 2003 4:13 am    Post subject: Reply with quote

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
View user's profile Send private message
jmckay123456789
n00b
n00b


Joined: 16 Aug 2003
Posts: 46

PostPosted: Fri Nov 21, 2003 7:52 pm    Post subject: Reply with quote

great, thanks guys. It sounds like the take home message is that magnitude does matter.


best,
Cedar
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum