getpriority() and top display for priority inconsistent
Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
cygwin@cygwin.com
Thu Aug 8 13:46:00 GMT 2019
> I pushed your patch with a short commit message.
Thanks! Thinking about that a little more, getpriority(PRIO_PROCESS) returns the cached version of priority (since the last
setpriority()) but should return "live" version by re-getting and re-caching the actual thing from the system:
1. The priority could have been changed from the outside (it is a windows process, after all, and anybody can use Task Manager, for example);
2. When pulling group or user priorities from getpriority(), those things get returned from fresh "winpids", which gets constructed
on-the-fly and so "nice" gets populated from the system; so the results can be, again, inconsistent (e.g. if compared to getpriority() for
the process alone, since it is a cached one);
3. "/proc/PID/stat" always shows the live results (even before my change, although it was showing the "wrong" value).
Thoughts?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list