1.
nice 优先级的范围为-20~ 19 等40个等级,其中数值越小优先级越高,数值越大优先级越低,既-20的优先级最高, 19的优先级最低
2. chrt 命令
chrt -p -r 50 <pid> 调整成RR 50
chrt -p <pid > 是查询
chrt -p -o 0 <pid> 调整成other
3. 创建后修改
int policy,
struct sched_param pram;
pthread_getschedparam(pthread_self(),&policy, ¶m);
policy= SCHED_RR
pram. sched_priority= 50; (1~99)
pthread_setschedparam(pthread_self(),policy, ¶m);