版權所有 © 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)
廣告