Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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/TMDXICE110: Restarting task

Part Number: TMDXICE110

Tool/software: TI-RTOS

Hello.

I created a test project and wrote a couple of test tasks. The task was successfully started and sended message to the console. In ROV, I saw that the tasks are terminated after their successful execution.

How can I restart completed tasks? Is there any way to do this?

  • Hi Kiselev,

    If you let a task "fall out" (e.g. the Task functions calls return) or if you call Task_exit on that thread, the task is terminated. The only way to "restart" it is to call Task_create (or Task_construct) for that task again.

    Generally tasks have a big while loop to wait for things to process. Common blocking mechanisms include pending on a semaphore that a interrupt posts when data is ready, calling Mailbox_pend to wait on a message from another thread, Task_sleep for some amount of time, and many more.

    Todd
  • When I cause to create a task, is the same task created, or will it be another task with different variables?
  • Hi Kiselev,

    If allocated in the Task_create, the stack is freed on the Task_delete. When the Task_create is called, the task assumes the stack contents are not valid. So all locals are whipped out. Please note that local static variables are persistent across a create/delete since they really are global variables whose scope is in the function that declares it.

    Todd