[Python-ideas] Add setpriority / getpriority to os module.

Josiah Carlson josiah.carlson at gmail.com
Sat Apr 11 04:44:21 CEST 2009


On Fri, Apr 10, 2009 at 6:58 AM, R. David Murray <rdmurray at bitdance.com> wrote:
> Christian Heimes <lists at cheimes.de> wrote:
>> Hello,
>>
>> I would like to add straight forward wrapper for the setpriority and
>> getpriority functions to posixmodule.c for the os module. The functions
>> allow to retrieve and modify the niceness of a process. They are in
>> particular useful for multiprocessing to implement low priority
>> processes. The functions are well known as 'nice' or 'renice' commands.
>>
>> The two functions and the constants PRIO_PROCESS, PRIO_PGRP, PRIO_USER,
>> PRIO_MIN and PRIO_MAX should be available on most POSIX operating
>> systems. A patch would come with autoconf tests for the feature.
>
> I don't think there's likely to be much controversy about putting
> these in.

Variants for Windows with roughly equivalent meanings would be nice.
It looks pretty straightforward with pywin32, but someone with ctypes
experience may be preferred.

 - Josiah



More information about the Python-ideas mailing list