This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: getpriority() and top display for priority inconsistent
- From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin at cygwin dot com>
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Date: Thu, 8 Aug 2019 13:45:57 +0000
- Subject: Re: getpriority() and top display for priority inconsistent
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=69nJPyFd5uAbNV5/Fr6Z9bPP0GeK5bkgTV5YQhJx7xM=; b=k4g0AhAMluPUFuOKYQcPqqgkvu+NTGZDyydcTjQ16vRApBzM/0zFE9Wc8bGs6nOsuCXyKPmCGOD2hM5WnRyKro4XIAeqmrtLgx6WklMDok5CBH8xZgnn1p0YTtQqNFbTaJowZotaeRmnIigxmTrOj4Sm1zgVoajAaYdhzjNySiJqdmsdGjsxcI9bCqFH2VrfGdxu4wEhBYcmRjHFVKH7hbiF3vVRw6jiOnlAmCWRyNJtx+N7x0mESrGZME4Z8fqaWqe7NeLv8K+2+bJThTHojA3fZh+OfD7HPCveguQPuNjDxg7t5jB/OxJTVq9HcEjNudpOAcO7txs8dlQcUUHnmA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B3TCi/V61eMlJfAROXq4aLPuKDWtvGwNUTphQ31v5DH5GLjeRXHmwq9CF24DDIFZMrUtDixFdNg+HB1hUJs6+dgyvXYtIxOvd9/G3rXvpmhEH/AsOMHspJXU3RJlrV/xdlKbmBIDqk32nIuXjCZaeR1qN1ciuryzG4ziL41T6/epDaGhhlGVGAX362wdx7yDraOI3hz5FPi1OFEMIy3phD9q2UUFYLfFaVFZSFHTjakhV9waolaznnXqbcqWpQnDBLDNPFIGk2bEmuU9I557Amd7d9M3thW/dy6uw/iX0yNFtpNLH/d8tRB1QQSzqDXFbpBovQqBpFZv7v2ZTNRrXw==
- Ironport-sdr: HAqqJygcEHziMtYUWMp39HWz50SGYNNX0fYaXiDHpJ8/4+6lnL7NVKkLHgQyWHIGB36Sj50G3s rKLu4O+U254A==
- Reply-to: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr at ncbi dot nlm dot nih dot gov>
> 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