多线程编程指南

pthread_attr_setschedpolicy(3C) 语法

int	pthread_attr_setschedpolicy(pthread_attr_t *tattr, int policy);
#include <pthread.h>



pthread_attr_t tattr;

int policy;

int ret;



/* set the scheduling policy to SCHED_OTHER */

ret = pthread_attr_setschedpolicy(&tattr, SCHED_OTHER);

SCHED_FIFOSCHED_RR 在 POSIX 标准中是可选的,而且仅用于实时线程。

有关调度的论述,请参见线程调度一节。