User`s guide
Tasks
Thread Scheduling 4-41
4.4.1.1 Creating and Deleting Tasks Dynamically
You can spawn DSP/BIOS tasks by calling the function TSK_create, whose
parameters include the address of a C function in which the new task begins
its execution. The value returned by TSK_create is a handle of type
TSK_Handle, which you can then pass as an argument to other TSK
functions.
TSK_Handle TSK_create(fxn, attrs, [arg,] ...)
Fxn fxn;
TSK_Attrs *attrs
Arg arg
A task becomes active when it is created and preempts the currently running
task if it has a higher priority.
The memory used by TSK objects and stacks can be reclaimed by calling
TSK_delete. TSK_delete removes the task from all internal queues and frees
the task object and stack by calling MEM_free.
Any semaphores, mailboxes, or other resources held by the task are not
released. Deleting a task that holds such resources is often an application
design error, although not necessarily so. In most cases, such resources
should be released prior to deleting the task.
Void TSK_delete(task)
TSK_Handle task;
Note:
Catastrophic failure can occur if you delete a task that owns resources that
are needed by other tasks in the system. See TSK_delete, in the TMS320
DSP/BIOS API Reference Guide for your platform for details.










