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.
hi,
I'm using EKS-LM3S9D92 board
with sys/bios 6.34.4.22
and i want to delete terminated task ??
I'm not sure what your question is.
SYS/BIOS supports the automatic deletion of terminated tasks if that is what you mean
This feature is enabled by adding the following to your .cfg file:
var Task = xdc.useModule('ti.sysbios.knl.Task'):
Task.deleteTerminatedTasks = true;
When this feature is enabled, an Idle function is installed that will delete one dynamically created task that has terminated each time through the Idle loop.
Since the work of finding and deleting terminated tasks is done within the Idle task, the application dynamics must occasionally allow for the Idle task to run in order for the feature to be effective.
If this feature is enabled, the application code is not allowed to also delete terminated tasks. Otherwise fatal race conditions will arise.
Alan
Alan DeMars said:If this feature is enabled, the application code is not allowed to also delete terminated tasks. Otherwise fatal race conditions will arise.
Alan
thank you for your reply
but i wnt to know if i use task_delete();
but for running task is any error occur??
You are not allowed to delete the currently running task.
But you are allowed to delete tasks that are READY to run or BLOCKED.
Alan
Hi Alan,
I would like to know what happens when you do Task_exit() and not do Task_delete() later, will any resources of that specific task be held up ?
And will my program terminate gracefully if I just do Task_exit() and leave out Task_delete() ?
Regards,
SYS/BIOS does not keep track of any resources (ie Semaphore objects) that a task may have created in its lifetime.
It is the application's responsibility to manage any objects that it creates.
So, for example, if a task creates a Semaphore, uses it for a while, then exits, the Task object and the Semaphore will persist until explicitly deleted by the application.
If the 'Task.deleteTerminatedTasks' flag is set to true, then SYS/BIOS will eventually delete the Task object (assuming it was dynamically created).
But it WILL NOT delete the Semaphore object that the task created. That is is the application's responsibility.
Alan
In answer to the second question about terminating gracefully: by default, until ALL tasks are exited, including the Idle task, the program will not terminate.
If all tasks, including the Idle task have terminated (ie called Task_exit()), BIOS will then simply call BIOS_exit().
No resource freeing (ie garbage collection) is performed within BIOS_exit().
Alan