程序中设置调度优先级

struct sched_param param;
int maxpri;
maxpri = sched_get_priority_max(SCHED_FIFO);//»ñÈ¡×î´óÖµ
if (maxpri == -1)
{
WriteLog("sched_get_priority_max() failed");
exit(1);
}
param.sched_priority = maxpri;
if (sched_setscheduler(getpid(), SCHED_FIFO, &param) == -1) //设置优先级

{
WriteLog("sched_setscheduler() failed");
exit(1);
}

posted @ 2019-06-04 09:12  MoonXu  阅读(1061)  评论(0编辑  收藏  举报