Hi,
Creating a thread and afterwards changing the priority and policy does
work. But setting the priority and policy when creating a thread doesn't
seem to work any more on 2.6.x/NPTL systems.
After invoking the following:
pthread_attr_init
pthread_attr_setschedpolicy FIFO
pthread_attr_setschedparam 99
pthread_create
The output of pthread_getschedparam within this thread seemed strange to me:
./thr_prio_basic
max priority 99
policy: 0 priority: 0
thread succesfully created
LD_ASSUME_KERNEL=2.4.1 ./thr_prio_basic
max priority 99
policy: 1 priority: 99
thread succesfully created
Is it because of stricter POSIX compliance of NPTL?
Using ltrace and strace didn't really make it clear to me what is going
wrong here.
In the LinuxThread case, I could clearly see the cloning happening and
afterwards the calls to "sched_setscheduler". In the NPTL case, there is
just a call to clone with more params. No calls to change scheduler
params. Does one of the params contain the scheduler options? If not,
how is the kernel supposed to get that information?
I really don't understand why this is happing, any explanation is
greatly appreciated.
With friendly regards,
Takis
PS: I wasn't sure if I should ask this on the glibc mailinglist or this
mailinglist. My apologies if this is off-topic.