2010-03-15 08:24:47     Thread Priorities etc

Document created by Aaronwu Employee on Sep 26, 2013
Version 1Show Document
  • View in full screen mode

2010-03-15 08:24:47     Thread Priorities etc

Stefan Wanja (GERMANY)

Message: 87205   

 

Hello,

 

I am trying to write a threaded application where I need different priorities. Now when I execute sched_get_priority_max and sched_get_priotiy_min I get the same value (99 for SCHED_FIFO and SCHED_RR, 0 for SCHED_OTHER).

 

This basically means, that I can not assign priorities other than the only one allowed.

 

Why is this, am I missing something? I am using toolchain_09r1_branch and uclinux-dist-2009.

 

Kind Regards,

 

Stefan

QuoteReplyEditDelete

 

 

2010-03-15 22:45:42     Re: Thread Priorities etc

Yi Li (CHINA)

Message: 87224   

 

Stefan,

 

Can you post your test program? If it shows what you have described, this would be a bug.

 

I've been using functions like sched_scheduler(), which works OK.

 

-Yi

QuoteReplyEditDelete

 

 

2010-03-17 13:21:53     Re: Thread Priorities etc

Stefan Wanja (GERMANY)

Message: 87339   

 

Hello again,

 

here is my example code:

 

#include <sys/types.h>

#include <errno.h>

#include <pthread.h>

#include <sched.h>

#include <signal.h>

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <stdint.h>

 

int    main( int argc, char **argv )

{

        printf("MAX FIFO PRIORITY=%d\n",sched_get_priority_max (SCHED_FIFO));

        printf("MIN FIFO PRIORITY=%d\n",sched_get_priority_max (SCHED_FIFO));

        printf("MAX RR PRIORITY=%d\n",sched_get_priority_max (SCHED_RR));

        printf("MIN RR PRIORITY=%d\n",sched_get_priority_max (SCHED_RR));

        printf("MAX OTHER PRIORITY=%d\n",sched_get_priority_max (SCHED_OTHER));

        printf("MIN OTHER PRIORITY=%d\n",sched_get_priority_max (SCHED_OTHER));

 

    return 0;

}

 

 

And the output is:

 

MAX FIFO PRIORITY=99

MIN FIFO PRIORITY=99

MAX RR PRIORITY=99

MIN RR PRIORITY=99

MAX OTHER PRIORITY=0

MIN OTHER PRIORITY=0

Attachments

    Outcomes