This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with BIOS thread preemption

Hi,

we have an application running on C67 with a few BIOS threads. We have recently came into a strange issue with preemption.

In a few words there are two threads - one with priority 6, another with priority 12. The higher priority thread does some actions periodically using TSK_sleep(5). And we can see that it comes to action roughly every 5 ms. But then, at some point the lower priority thread needs to perform another action that in total takes around 60 ms. I would expect that when it comes to action it will be preempted every 5 ms by a higher priority thread. The problem is it does not happen. The higher priority thread does not get processor's time until lower priority thread finishes. There are no synchronization mechanisms used - just TSK_sleep in higher priority thread.

The work to do in lower priority thread was changed to a simple while loop where we check one of the counters to see if 60 ms already passed. It changed nothing. 

We also tried to call TSK_enable just before the loop in case by some mistake TSK_disable was called - it changed nothing.

Interrupts are not disabled.

Any ideas what might be wrong or what else we could check?

Thanks in advance,

Wojtek

  • Wojtek,

    What version of BIOS are you using?

    If interrupts are not disabled, you should still be getting the Timer interrupt.  The default is Hwi14.  Can you make sure that the Timer interrupt is still being generated!  Otherwise your TSK_sleep would never wake up.

    Are you able to use ROV to view the state of the system?  Make sure you HWI and TSK stacks do no overflow.  After that it would be checking the KNL mask and readyQs to make sure they are not out of sync.

    Judah

  • Hi Judah,

    this occurred to be a false alarm. Hard to admit but we faced a classical example of priority inversion :)

    Still thanks for your help,

    Wojtek