How can a task with lower priority to recover from starvation?

Basic fact, a lower priority task CAN’T force itself to get time when I higher priority task is using all the time (except by changing priorities) as that is fundamental to how task priorities are defined.

This is one application for defining a ‘watchdog’, as either a very high priority task or an interrupt that monitors task operations and detects system stalls.

Ultimately the best recovery action is to let the programmer know that some task is taking more time than it should so they can fix the bug that is causing that (or re-evaluate the whole system design).

2 Likes