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.

Dynamically vs Statically created Tasks in TI-RTOS

Other Parts Discussed in Thread: CC2650

Folks,

Other than less code written by the user, what's another advantage of creating a Task statically vs dynamically?

Is there any speed improvement, or performance in general?

Thanks

  • Pototo,

    The primary benefit of creating Tasks statically is that the Task creation code (both the application calls to Task_create(), and Task_create() itself) does not need to reside on the target, so code footprint is reduced.  Once a Task is created, there is no difference in performance depending on whether it was statically or dynamically created.  

    A key benefit for dynamic creation is that these tasks can be dynamically deleted.

    You might want to open Bios_User_Guide.pdf in your installation, and search for mentions of “static”.

    Scott

  • I did look at both the TI-RTOS and SYS/BIOS User Guides, but did not find anything concrete other than code footprint and the Task_delete() for deleting dynamic tasks (which is very useful in my case). Thanks!

  • Hi Scott,

    I have a question too similarly about dynamic vs static.

    If a task was statically defined, will it appear in the cfg file? 

    The reason I ask is because the SensorTag example project for CC2650 which is TI-RTOS based is using tasks (It can be seen it in the code) but when I go to the cfg file under tasks->instances I see the list of tasks is empty. I assume TI configured the tasks statically and therefore they cannot be configured dynamically.

    I might have answered my own question but I would like you to please confirm my understanding.

  • Statically created tasks show up in the .cfg. I think the CC2650 examples generally use Task_construct instead of Task_create. Task_construct is exactly like Task_create, but the caller supplies the Task object instead of having the Task_create allocate the object.