getpriority() and top display for priority inconsistent

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Aug 8 15:40:00 GMT 2019


On Aug  8 13:45, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin wrote:
> > 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?

Feel free to provide a patch, just, please, create a valid git commit
message and send the stuff to cygwin-patches (unless the patch is
really trivial).


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190808/3ea02e76/attachment.sig>


More information about the Cygwin mailing list