How to set priority of sched_param?
Hello everyone! I can't seem to set the realtime priority of a certain task using via the sched_param struct. I need to do it that way so that when my sched_param struct has a priority, I can now place it as argument in the sched_setscheduler() function. My assignment statement to increase the priority by 10 is:
struct sched_param param;
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 10;
but this has no effect, like when I try to print the priority using this:
static int prio;
prio = getpriority(PRIO_PROCESS, 2174);
The value of prio is 0. 2174 is the pid of the process. Is there other way to initialize the value of sched_param?
Thanks!
Last edited by archieval; 04-24-2007 at 04:32 AM.
|