I wondering what method you're using to monitor the sanity state of the RTOS and activate a watchdog in case of failure.
Currently, I have a hardware watchdog feed in the lower priority task . But in some case it's not working : The RTX can be OK but one task can be stuck , or buffers cannot be allocated or others reasons.
According to you , what is the best method ?
thanks in advance.
But it may be correct to constantly have zero blocks free. One example is when you have an LRU cache. The cache will fill until all entries are used.
After becoming full, new allocations will require a concurrent block release. A thread that looks at the number of free blocks will never even see the LRU block swap, since the LRU code most probably don't release any block - it just overwrites the old contents and relinks the block. And even if there is a quick release followed by an allocation, a thread polling may never catch that tiny interval when one block is free.
So if you want code to keep track of block allocations, you may have to keep track of threads that constantly fail to allocate instead of relying on the current number of allocated blocks. It isn't the number of used blocks that is a problem, but a thread being starved of a required resource.