[pygtk] Subprocess and changing it's priority

Vláďa vladovi at atlas.cz
Tue Feb 26 09:11:53 WST 2008


Thanks,

I looked at this before I posted my question. If I understand it 
correctly, it sets the priority of the callback, not of the process. I 
did some tests and no matter what I'm setting here, the subprocess is 
always running at normal priority.

I also found this: http://docs.python.org/lib/node528.html (at the 
bottom - creationflags). This would at least allow me to set the 
priority when the process starts.

I've now discovered one strange thing. On my home computer when I run 
the process (it is an XviD encoder) from my application, it only uses 
1/3 - 1/2 of my CPU, the rest is unused. If I run the same command from 
a .bat file, it uses my whole CPU as expected and runs much faster.

Even more strange is, that this only happens on 1st pass, second pass 
uses my whole CPU. Do you have any idea why? Btw. I have a single core CPU.

Vlada


Gian Mario Tagliaretti napsal(a):
> On Mon, Feb 25, 2008 at 11:49 AM, Vláďa <vladovi at atlas.cz> wrote:
>
> Hi
>
>   
>>  Everything works fine. But I'd like to add an option to change priority
>>  of the process I started. It is a video encoder, so it uses 100% of CPU
>>  and takes hours to finish. So you might want to lower it's priority. Is
>>  there an easy way do do it? Thank you.
>>     
>
> Have a look at the reference manual for gobject.timeout_add
> http://www.pygtk.org/docs/pygobject/gobject-functions.html#function-gobject--timeout-add
>
> cheers
>   


More information about the pygtk mailing list