优先级常量


以下进程调度常量由 os.constants.priority 导出。

常量 描述
PRIORITY_LOW 最低进程调度优先级。这与 Windows 上的 IDLE_PRIORITY_CLASS 相对应,在所有其他平台上的值为 19
PRIORITY_BELOW_NORMAL 进程调度优先级高于 PRIORITY_LOW 且低于 PRIORITY_NORMAL。这对应于 Windows 上的 PRIORITY_NORMAL,并且在所有其他平台上的值为 10
PRIORITY_NORMAL 默认的进程调度优先级。这对应于 Windows 上的 NORMAL_PRIORITY_CLASS,并且在所有其他平台上的值为 0
PRIORITY_ABOVE_NORMAL 进程调度优先级高于 PRIORITY_NORMAL 且低于 PRIORITY_HIGH。这对应于 Windows 上的 ABOVE_NORMAL_PRIORITY_CLASS,并且在所有其他平台上的值为 -7
PRIORITY_HIGH 进程调度优先级高于 PRIORITY_ABOVE_NORMAL 且低于 PRIORITY_ABOVE_NORMAL。这对应于 Windows 上的 HIGH_PRIORITY_CLASS,并且在所有其他平台上的值为 -14
PRIORITY_HIGHEST 最高进程调度优先级。 这对应于 Windows 上的 REALTIME_PRIORITY_CLASS,在所有其他平台上的值为 -20

The following process scheduling constants are exported by os.constants.priority.

Constant Description
PRIORITY_LOW The lowest process scheduling priority. This corresponds to IDLE_PRIORITY_CLASS on Windows, and a nice value of 19 on all other platforms.
PRIORITY_BELOW_NORMAL The process scheduling priority above PRIORITY_LOW and below PRIORITY_NORMAL. This corresponds to BELOW_NORMAL_PRIORITY_CLASS on Windows, and a nice value of 10 on all other platforms.
PRIORITY_NORMAL The default process scheduling priority. This corresponds to NORMAL_PRIORITY_CLASS on Windows, and a nice value of 0 on all other platforms.
PRIORITY_ABOVE_NORMAL The process scheduling priority above PRIORITY_NORMAL and below PRIORITY_HIGH. This corresponds to ABOVE_NORMAL_PRIORITY_CLASS on Windows, and a nice value of -7 on all other platforms.
PRIORITY_HIGH The process scheduling priority above PRIORITY_ABOVE_NORMAL and below PRIORITY_HIGHEST. This corresponds to HIGH_PRIORITY_CLASS on Windows, and a nice value of -14 on all other platforms.
PRIORITY_HIGHEST The highest process scheduling priority. This corresponds to REALTIME_PRIORITY_CLASS on Windows, and a nice value of -20 on all other platforms.