EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #144 background imageLoading...
Page #144 background image
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, Creating
DSP/BIOS Objects Dynamically, page 2-16, for a discussion of the benefits
of creating objects statically.

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals