[En-Nut-Discussion] Thread priority

Dusan Ferbas dferbas at etech.cz
Thu May 17 09:29:32 CEST 2007


Hi Michel,

we use NutSleep(200) and set priority for such a thread to 5.

It is also good for heap checking and it easy discovers data driven 
endless loops.


At 17:11 16.5.2007, you wrote:
>Yes, I see what you are saying. That is why we sleep 100ms in that thread:
>
>     NutThreadSetPriority(1);
>     for (;;)
>     {
>         NutSleep(100);
>         WatchDogRestart();
>     }
>
>Our watchdog is set to 2 seconds, so there should be enough time
>even if a thread would use 1,89999 seconds before releasing the CPU.
>
>
>The reason I want to give this watchdog thread the highest priority
>is because I found that, if I am busy in another thread, that thread
>will not give back the CPU if it uses a higher priority. Even when using


Dusan  




More information about the En-Nut-Discussion mailing list