|
struct sched_param param;
int policy, result;
result = pthread_getschedparam(pthread_self(), &policy, ¶m);
policy = SCHED_OTHER;
result = pthread_setschedparam(pthread_self(), policy, ¶m);
fprintf(stderr, "%d, %d\n", sched_get_priority_min(SCHED_OTHER), sched_get_priority_max(SCHED_OTHER));
fprintf(stderr, "%d, %d\n", policy, param.sched_priority);
上面的代码表明SCHED_OTHER参数,普通用户不起作用?
|