0%

Linux下调节进程优先级

命令
nice(1): 以指定优先级运行程序

1
2
nice [OPTION] [COMMAND [ARG]…]
nice –n 1 ls

renice(8): 调整运行进程的优先级

1
2
renice priority [[-p] pid …] [[-g] pgrp …] [[-u] user …]
renice +1 987 -u daemon root -p 32

API
nice(2): 改变进程优先级

1
int nice(int inc);

getpriority(2): 获取优先级

1
int getpriority(int which, int who);

setpriority(2): 设置优先级

1
int setpriority(int which, int who, int prio);

Reference:
http://unix-cd.com/unixcd12/article_4602.html