peter-hst / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

ionice on windows #328

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Proposal
port get_ionice() set_ionice() to windows 7/vista

Proposed API
map calls to IoGetIoPriorityHint and IoSetIoPriorityHint
Are there existent implementations we can use as an example?
process lasso made me think of that. psutil based opensource multiplatform 
process lasso clone maybe?
https://rubygems.org/gems/windows_ionice 
i found this on sf http://sourceforge.net/projects/iopriority/
Please provide any additional information below.

http://msdn.microsoft.com/en-us/library/ff549710.aspx
http://stackoverflow.com/questions/301290/how-can-i-o-priority-of-a-process-be-i
ncreased

Original issue reported on code.google.com by Cedric.l...@gmail.com on 19 Sep 2012 at 8:45

GoogleCodeExporter commented 8 years ago
Hi.
I'm not in Italy right now.
Are you willing to provide a patch?

Original comment by g.rodola on 19 Sep 2012 at 11:58

GoogleCodeExporter commented 8 years ago
Ok, today I tried to spend some time on this and here's what I came up with.
It seems I'm able to get IO priority of a process but not to set it.
Not sure what's wrong with it.
Just attaching the patch for now.

Original comment by g.rodola on 12 Dec 2012 at 5:50

Attachments:

GoogleCodeExporter commented 8 years ago
In set_process_io_priority, instead of using handle_from_pid you need to use 
handle_from_pid_waccess with PROCESS_SET_INFORMATION.

Original comment by wj32...@gmail.com on 13 Dec 2012 at 2:20

GoogleCodeExporter commented 8 years ago
Thanks, it worked (although I had to use PROCESS_ALL_ACCESS).
Committed in r1555.

Side note: I was able to set 2 (normal), 1 (low) and 0 (very low) but I wasn't 
able to use any other value. I noticed PH also provides an "high" value. What 
number is that mapped to?

Original comment by g.rodola on 13 Dec 2012 at 2:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1555 == revision c64779adec4f

Original comment by g.rodola on 2 Mar 2013 at 12:13

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 8 Apr 2013 at 1:21

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 11 Apr 2013 at 9:17

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 12 Apr 2013 at 6:21