版權所有 © 2014 tutorialspoint
#include <sched.h> int sched_setparam(pid_t pid, const struct sched_param *param); int sched_getparam(pid_t pid, struct sched_param *param); struct sched_param { ... int sched_priority; ... };
int sched_setparam(pid_t pid, const struct sched_param *param);
int sched_getparam(pid_t pid, struct sched_param *param);
struct sched_param { ... int sched_priority; ... };
sched_getparam() 檢索由pid標識的程序的排程引數。如果pid為零,則檢索當前程序的引數。
sched_setparam() 檢查param對於程序的排程策略的有效性。引數param->sched_priority必須位於sched_get_priority_min(2) 和sched_get_priority_max(2)給定的範圍內。
有關與排程優先順序和策略相關的許可權和資源限制的討論,請參見sched_setscheduler(2)。
在sched_setparam() 和sched_getparam() 可用的POSIX系統中,在<unistd.h>中定義了_POSIX_PRIORITY_SCHEDULING。
getpriority (2)
nice (2)
sched_get_priority_max (2)
sched_get_priority_min (2)
sched_getaffinity (2)
sched_getscheduler (2)
sched_setaffinity (2)
sched_setscheduler (2)
setpriority (2)
廣告