allacmc
(Allan Caldas)
February 11, 2024, 10:56pm
1
Please clear my doubts?
When I have a task running and within that task there is, for example:
A traffic light with take and give.
Then, from within another task, I go there and delete this running task… How do I know what state the Semaforo is in??
Sample:
and …
Unless you have provided some path to know, you don’t. (you could interogate it yourself).
If this is a Mutex, then you may be in a bad state if it held the Mutex when the task was deleted, as then no one exists that can give it.
Basically, deleting task when you don’t know their current state is generally a very bad idea.
allacmc
(Allan Caldas)
February 24, 2024, 10:53pm
3
Thank you for the response.
I implemented a semaphore and only delete the task when the semaphore is available.
allacmc
(Allan Caldas)
February 24, 2024, 10:54pm
4
I would like to know if the same also applies to vTaskSuspend and vTaskResume
hs2
(Hartmut Schaefer)
February 24, 2024, 11:17pm
5
These functions are task related. No 3rd party involved which could be left in an unwanted or unknown state.
BUT also these functions are somewhat special because a task can be suspended at any time without any synchronization. It’s easy to get trapped by subtle race conditions.
allacmc
(Allan Caldas)
February 24, 2024, 11:20pm
6
Systems development with the FreeRTOs environment involves a change in mindset, the way we think about system development is different from superloop.