Linux top gives you (priority + (19 - nice)). I'm pretty happy just
giving priority and nice as they are, but maybe it would be good to
document what linux top does.
> I'm not sure how you
> go about calculating a more accurate priority but, if we can,
> perhaps we just expose a new attribute for it when it is ready?
Our priority is pretty accurate, the tests go through a lot of pain to
test out the different schedulers etc and make sure it's correct (when
running as root at least). It's just that it's the instantanious
priority (just like top), while there are many factors interesting:
the scheduler class, base priorities etc. Also the priority of a
process on UNIX is generally the priority of the "representative
thread/LWP" because the threads are the schedulable entities. This
works well for single threaded processes but hides stuff in
multithreaded situations.
I don't think what we provide now is wrong, I just think we don't
provide the whole picture. What made me write this in the first place
was because on Windows I couldn't find the instantanious priority,
only the configurable parameters which the kernel uses to work out the
priority.
Maybe the priority attribute should be left alone and there would only
be more information about priorities in the future. But it's because
I currently haven't got a big enough picture of all the scheduling,
threading and priority information that plays part in this that I
don't know if it would still be meaningful (it would be for a
thread/LWP I think).
Regards
Floris