Does anyone know of an easy way to set the niceness value of a Process or Pool when it is created in multiprocessing?
A:
Try importing the ctypes module and looking for pthread_schedparam() or SetThreadPriority() (Linux / Windows).
Pestilence
2010-02-02 01:47:43
+1
A:
os.nice(increment)
Add increment to the process’s “niceness”. Return the new niceness. Availability: Unix.
From http://docs.python.org/library/os.html#os.nice
Is there a reason you can't call this in the child process?
Richo
2010-02-02 03:26:10
Thanks. This looks like it will work. I'll have to try it in a bit when I have access to my code.
myurko
2010-02-02 20:37:32
It worked! Thanks.
myurko
2010-02-02 23:58:26