Hi everybody
Is there any situation in which kernel decides to delete a task ? In other words, should I check a task’s state regularly in my task handler ? If there is a need, how should I delete this task completely after detecting that the state is eDeleted ? Regard the assumption that idle task is starved.
No, the FreeRTOS Kernel does not delete a task until you explicitly call vTaskDelete.
There are 2 possible cases:
- A task deletes another task: In this case all the resources (task stack and TCB) are released in the vTaskDelete itself.
- A task deletes itself: In this case all the resources (task stack and TCB) are released by the IDLE task. It is your responsibility to ensure that the IDLE task is not starved to ensure that the resources are released.
1 Like