Can you limit CPU resources for the running app ?

I use a little utility from DonationCoder.com called Process Tamer - it watches for processes that are sucking up too much CPU time and lowers their priority (it also lets you exempt certain programs from being “tamed”). Process Explorer - one of the excellent SysInternals utilities - also allows you to adjust the priority of running processes. So the capability is out there. At least now you know that your search is a terminating one…

···

On Jan 16, 2008 4:40 PM, Robin Dunn robin@alldunn.com wrote:

Geoff Skerrett wrote:

I have a wx app that does some image processing. Occasionally a user
will select a large number of images (100+) and it can take 30-40mins to
complete the process. All of the users are WindowsXP.

Is there anyway to “restrict” the amount of cpu/resources that the
application uses ?

The users understand that it takes a specific amount of time, however,

they would like to use their workstation for other tasks. Once
launched our app consumes all the cpu resources so the workstation
appears “Frozen”.

I have little experience with threading, but was wondering if this would

solve the problem. I noticed in the python docs that the “threading”
class says that is does not have support for priorities - which sound
like what I am looking for, but unsure.

Note that this is not a case of the the user complaining that the app’s
GUI is unresponsive, but rather that the entire SYSTEM is un-responsive.

I know that there is a win32 API for limiting a process to just one CPU,

so I expect that there are APIs for setting priority (like unix’s nice()
function) but I don’t know details. Searching MSDN will probably turn
up something, and then you can probably use ctypes to call it.


Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org


www.fsrtechnologies.com