Tasks
4-40
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.
4.4.1.2 Creating Tasks Statically
You can also create tasks statically using Tconf. The configuration allows you
to set a number of properties for each task and for the TSK Manager itself.
For a complete description of all TSK properties, see
TSK Module
in the
TMS320 DSP/BIOS API Reference Guide
for your platform.
While it is running, a task that was created statically behaves exactly the
same as a task created with TSK_create. You cannot use the TSK_delete
function to delete statically-created tasks. See Section 2.4,
, page 2-16, for a discussion of the benefits
of creating objects statically.
Содержание TMS320 Series
Страница 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Страница 16: ...xvi ...
Страница 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Страница 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Страница 202: ...5 20 ...
Страница 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Страница 288: ...Index 10 Index ...