This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/TMDSEVM6678: How to delete tasks when there are tasks being created continuously ?

Part Number: TMDSEVM6678

Tool/software: TI-RTOS

I'm using tasks for a continuous similar process on eight cores.  Each core is creating three tasks dynamically, and at the hook function for exiting the tasks I'm creating the same task with the same priority, so that the three tasks get processed with the order they were created.  Also I have enabled the Task_deleteTerminatedTasks option in config file so that I can free up the memory for newer tasks.  But it seems that since the cores never hit the idle task, the terminated tasks never get deleted.  I just can't find a solution to when and where I can get the terminated tasks deleted.  Does anyone have any idea of how to do this?

  • Hi,

    I've notified the sw team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • MN,

    Please look at the discussion on the TI RTOS E2E thread here which refers to the same topic.
    e2e.ti.com/.../263423

    you will need to add a blocking condition so that the idle task is allowed to run atleast when as you mentioned all the tasks have completed their execution.

    Regards,
    Rahul
  • Thanks Rahul for your reply.

    So you mean I should somehow call an idle function?  Then, would it come back out of idle by itself when there are tasks ready to be executed?

  • Yes, that is my recommendation. Idle task is lowest priority task so whenever any other task is ready to execute the TI RTOS scheduler will bring the core out of idle due to the pre-emptive mode of operation.
  • Great, Thanks! I just added function Idle_run() in my exit hook function and it works perfectly. However it is taking around 2700 cycles to run. Not sure if it's about the right number of cycles to delete a task and if there is a way to minimize it!
  • Thanks for confirming the issue is fixed. How long does it takes to hit idle depends on the number of higher priority threads running in your system and when the Idle_run() gets called. You can also look at the system analyzer to look at what else is running in the system at a given instance of time.