-   Programming (
-   -   Need FIFO thread scheduling policy (

enigma82 04-20-2005 08:35 AM

Need FIFO thread scheduling policy

I am posting on behalf of a friend (had a temporary problem with posting)!
Here is the post:

I've tried to write a C program to change the default thread scheduling policy from SCHED_OTHER to SCHED_FIFO. Though the program does not have any errors it doesn't seem to work. The threads execut in the same manner!
Can someoen help me with some advice or code sequence? Do I need a special real time linux kernel in order to do that?

I am using: RedHat 9.0 with the default kernel!
Here is the code that I am using at the moment:

pthread_t real;
pthread_attr_t realAttributes;
sched_param fifoLevel;
fifoLevel.sched_priority = (sched_get_priority_max(SCHED_FIFO) +
sched_get_priority_min(SCHED_FIFO)) / 2;


pthread_attr_setschedpolicy(&realAttributes, SCHED_FIFO);
pthread_attr_setschedparam(&realAttributes, &fifoLevel);
pthread_create(&real, &realAttributes, realmain, NULL);


All times are GMT -5. The time now is 08:29 AM.