We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 56015

14.5 EDK - Xilkernel scheduling policy does not work when using SCHED_PRIO


In Xilkernel designs using the scheduling policy set to SCHED_PRIO, it can be seen that the kernel is not executing the pthreads as expected.

In some situations, even though the SCHED_PRIO is used, the scheduling policy executes using a ROUND_ROBIN policy.

How can this issue be addressed?


When using SCHED_PRIO, the pthread scheduling priority needs to be set before the pthread_create is called using the pthread_setschedparam function.

For example, following is a three threaded system that is set up correctly:

void* master_thread (void *arg) {
    pthread_t threadID1, threadID2, threadID3;
    struct     sched_param sp;
    sp.sched_priority = 1;
    pthread_setschedparam(threadID1, 0, &sp);
    pthread_create(&threadID1, NULL, Thread_1, NULL);
    sp.sched_priority = 2;
    pthread_setschedparam(threadID2, 0, &sp);
    pthread_create(&threadID2, NULL, Thread_2, NULL);
    sp.sched_priority = 3;
    pthread_setschedparam(threadID3, 0, &sp);
    pthread_create(&threadID3, NULL, Thread_3, NULL);
    return NULL;

For more information on the Xilkernel API, see the Xilkernel Documentation at: http://www.xilinx.com/support/documentation/sw_manuals_j/xilinx14_5/oslib_rm.pdf.

AR# 56015
Date 05/15/2013
Status Active
Type General Article
  • EDK - 14.2
  • EDK - 14.3
  • EDK - 14.4
  • EDK - 14.5
Page Bookmarked