linux应用进程优先级配置
example:
#include <sched.h>
int set_process_priority(void)
{
int pri;
struct sched_param param;
pri = sched_get_priority_min(SCHED_RR);
if (pri == -1) {
printf("sched_get_priority_max() failed\n");
return -1;
}
param.sched_priority = pri;
if (sched_setscheduler(getpid(), SCHED_RR, ¶m) == -1) {
printf("sched_setscheduler() failed\n");
return -1;
}
return 0;
}
标签:sched,pri,return,param,priority,linux,进程,优先级 From: https://www.cnblogs.com/WangYangkai/p/17613473.html