Muhammad Waqas Athar

Implementing MQX Task Manager

Discussion created by Muhammad Waqas Athar on Dec 7, 2012
Latest reply on Dec 12, 2012 by Juraj Vanco

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:

  1. Get Kernal Data
  2. Iterate through task list
  3. Determine Error Code of Each task
  4. Decide what to do ,  (abort them, restart them) or do nothing
  5. 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.