开发者

Multiprocessing and niceness value

开发者 https://www.devze.com 2022-12-19 08:47 出处:网络
Does anyone know of an easy way to set the niceness value of a Proc开发者_如何学JAVAess or Pool when it is created in multiprocessing?os.nice(increment)

Does anyone know of an easy way to set the niceness value of a Proc开发者_如何学JAVAess or Pool when it is created in multiprocessing?


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?


Try importing the ctypes module and looking for pthread_schedparam() or SetThreadPriority() (Linux / Windows).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号