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 #169 background imageLoading...
Page #169 background image
Mailboxes
Thread Scheduling 4-65
4.8 Mailboxes
The MBX module provides a set of functions to manage mailboxes. MBX
mailboxes can be used to pass messages from one task to another on the
same processor. An intertask synchronization enforced by a fixed length
shared mailbox can be used to ensure that the flow of incoming messages
does not exceed the ability of the system to process those messages. The
examples given in this section illustrate just such a scheme.
The mailboxes managed by the MBX module are separate from the mailbox
structure contained within a SWI object.
MBX_create and MBX_delete are used to create and delete mailboxes,
respectively. You can also create mailbox objects statically. See Section 2.4,
Creating DSP/BIOS Objects Dynamically, page 2-16, for a discussion of the
benefits of creating objects statically.
You specify the mailbox length and message size when you create a mailbox
as shown in Example 4-12.
Example 4-12. Creating a Mailbox
MBX_pend is used to read a message from a mailbox as shown in Example
4-13. If no message is available (that is, the mailbox is empty), MBX_pend
blocks. In this case, the timeout parameter allows the task to wait until a
timeout, to wait indefinitely, or to not wait at all.
Example 4-13. Reading a Message from a Mailbox
Conversely, MBX_post is used to post a message to the mailbox as shown in
Example 4-14. If no message slots are available (that is, the mailbox is full),
MBX_post blocks. In this case, the timeout parameter allows the task to wait
until a timeout, to wait indefinitely, or to not wait at all.
MBX_Handle MBX_create(msgsize, mbxlength, attrs)
Uns msgsize;
Uns mbxlength;
MBX_Attrs *attrs;
Void MBX_delete(mbx)
MBX_Handle mbx;
Bool MBX_pend(mbx, msg, timeout)
MBX_Handle mbx;
Void *msg;
Uns timeout; /* return after this many */
/* system clock ticks */

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