chapter  12
TCMQ
HREAD OMMUNICATION WITH ESSAGE UEUES
Pages 5

One or more messages can reside in a message queue, which generally observes a FIFO discipline. A message queue that can hold just a single message is commonly called a

mailbox

. The

tx_queue_send

service places messages in the rear of a queue and the tx_queue_ receive service removes messages from the front of a queue. The only exception to this protocol occurs when a thread is suspended while waiting for a message from an empty queue. In this case, ThreadX places the next message sent to the queue directly into the thread’s destination area, thus bypassing the queue altogether. Figure 12.1 illustrates a message queue.