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 #173 background imageLoading...
Page #173 background image
Mailboxes
Thread Scheduling 4-69
Figure 4-15. Trace Results from Example 4-15
Associated with the mailbox at creation time is a total number of available
message slots, determined by the mailbox length you specify when you
create the mailbox. In order to synchronize tasks writing to the mailbox, a
counting semaphore is created and its count is set to the length of the
mailbox. When a task does an MBX_post operation, this count is
decremented. Another semaphore is created to synchronize the use of
reader tasks with the mailbox; this counting semaphore is initially set to zero
so that reader tasks block on empty mailboxes. When messages are posted
to the mailbox, this semaphore is incremented.
In Example 4-15, all the tasks have the same priority. The writer tasks try to
post all their messages, but a full mailbox causes each writer to block
indefinitely. The readers then read the messages until they block on an empty
mailbox. The cycle is repeated until the writers have exhausted their supply
of messages.
At this point, the readers pend for a period of time according to the following
formula, and then time out:
TIMEOUT*1ms/(clock ticks per millisecond)
After this timeout occurs, the pending reader task continues executing and
then concludes.

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