AnsweredAssumed Answered

VDK: Threads do not execute while System is idle

Question asked by gpetrowitsch on Nov 23, 2010
Latest reply on Dec 2, 2010 by gpetrowitsch

Hi,

 

we're having a problem on a BF548 system, for which we wrote a large

VDK based application.

 

There are several threads with different priorities:

- Priority 4 used for Ethernet related threads

- Priority 5 used for a CAN service thread

- Priority 6, which is round robin, used for some other threads

- Priority 7 used for low prio tasks

 

All works fine, if I don't start the CAN service thread. But if I

start it (which is the only one at priority 5), one thread at priority 6

does not get processor time anymore. This thread is a boot thread.

 

I'm definitely sure, that the CAN thread does not take all the processor

time. It frequently pends on a semaphore, waiting for messages to

arrive. If no messages arrive at all, it even pends for a semaphore

forever, but still the boot thread (at prio 6) doesn't get executed.

Other prio 6 threads however are executed, regardless of this prio 5

thread.

 

When I run the profiler, I see, that the system is idle more than 90% of

the time, regardless of whether the CAN thread is running or not.

 

Does anyone have any idea, what I can do about this to make my

boot thread run again?

 

Regards,

Gerhard

 

NEWS:

I found out in the meantime, that the CAN thread blocks not only the boot

thread but also some other lower prio threads. It does do this only, when

it pends on a semaphore. If I remove the pend and just let the CAN thread

sleep for 1 tick, everything works fine. But this is not a solution, as in this

case, the high priority CAN thread executes all the time, even if there's

nothing to do for it. In other words: instead of pending for the semaphore

it polls for the data.

Outcomes