int sched_setparam(pid_t pid, const struct sched_param *p);
int sched_getparam(pid_t pid, struct sched_param *p);
int sched_priority;
...
};
sched_setparam
은 스케줄링 매개 변수를 pid에 의해 인식되는 프로세스를 위해 스케줄링 정책과 관련해서 설정한다. pid 가 0이면 현제 프로세스의 매개 변수들이 설정된다.
매개 변수 p의 해석은 선택된 정책에 달렸다. 현재, 아래 세가지 스케줄링 정책이 리눅스에서 지원된다:
SCHED_FIFO,
SCHED_RR,
와
SCHED_OTHER.
sched_getparam
는 pid 로 구분되는 프로세스를 위해 스케줄링 매개 변수를 검색한다.
pid 가 0이면, 현재 프로세스의 매개 변수는 검색된다.
sched_setparam
는 프로세스의 스케줄링 정책을 위해 p의 유효성을 확인한다.
매개 변수p->sched_priority는 반드시 sched_get_priority_min와
sched_get_priority_max에 의해 주어진 범위 안에 있어야 한다.
sched_setparam
와
sched_getparam
이 가능한 POSIX 시스템은 <unistd.h>안에
_POSIX_PRIORITY_SCHEDULING
를 규정한다.
sched_setscheduler(2) has a description of the Linux scheduling scheme.
Programming for the real world - POSIX.4
by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0
IEEE Std 1003.1b-1993
(POSIX.1b standard)
ISO/IEC 9945-1:1996