Hello mqx users,
I have been using mqx to prototype my system. I have created many tasks that run and perform different kind of work. I need to have a task that runs as a supervisor to manage all running tasks. I need to monitor their error codes/health somehow to manage them and to decide what to do in case something goes wrong (e.g un handled interrupts ) and to take appropriate action maybe abort or restart them.
I went through MQXRM , and found out 2 functions, _task_get_error, _task_set_error, that are used to set or get error codes, but unfortunatly they work for currently active task.
I need to know any such mechanism that i should follow to determine error codes of all tasks.
I believe since mqx do not has such function it should be like this
In Supervisor task:
- Get Kernal Data
- Iterate through task list
- Determine Error Code of Each task
- Decide what to do , (abort them, restart them) or do nothing
- sleep for sometime
I do not yet to know this would work or not, this is what i assumed after seeing task structure in mqx soure code.
If this is how they can be managed , Do i have to disable interrupts or maybe disable preemption while supervisor task is running.
Or maybe i could set up exception handlers for each task or use global events to indicate something has gone wrong to supervisor, to let it decide what to do.