I created two threads. By default, they have priority 0, which I can see using pthread_getschedpaparam, and then I try to increase their priority to say 2and 3accordingly. But, if I try to do this, I get an error
error setting priority for T1: (1), Operation not permitted
error setting priority for T2: (1), Operation not permitted
I used a schedule policy SCHED_RRfor them
int sched = SCHED_RR;
and then did the following: -
if (pthread_setschedparam(t1, sched, &t1_param) != 0)
{
std::cout << "error setting priority for T1: (" << errno << "), " <<
strerror(errno) << std::endl;
}
What is the reason why I cannot change the priority of my threads, since the priority is in the range from 1to 99for SCHED_RR.
source
share