RTEMS Logo

RTEMS 4.10.2 On-Line Library


Message Manager MESSAGE_QUEUE_BROADCAST - Broadcast N messages to a queue

PREV UP NEXT Bookshelf RTEMS C User's Guide

10.4.6: MESSAGE_QUEUE_BROADCAST - Broadcast N messages to a queue

CALLING SEQUENCE:

rtems_status_code rtems_message_queue_broadcast(
  rtems_id    id,
  const void *buffer,
  size_t      size,
  uint32_t   *count
);

DIRECTIVE STATUS CODES:

RTEMS_SUCCESSFUL - message broadcasted successfully
RTEMS_INVALID_ID - invalid queue id
RTEMS_INVALID_ADDRESS - buffer is NULL
RTEMS_INVALID_ADDRESS - count is NULL
RTEMS_INVALID_SIZE - invalid message size

DESCRIPTION:

This directive causes all tasks that are waiting at the queue specified by id to be unblocked and sent the message contained in buffer. Before a task is unblocked, the message buffer of size byes in length is copied to that task's message buffer. The number of tasks that were unblocked is returned in count.

NOTES:

The calling task will be preempted if it has preemption enabled and a higher priority task is unblocked as the result of this directive.

The execution time of this directive is directly related to the number of tasks waiting on the message queue, although it is more efficient than the equivalent number of invocations of rtems_message_queue_send.

Broadcasting a message to a global message queue which does not reside on the local node will generate a request telling the remote node to broadcast the message to the specified message queue.

When a task is unblocked which resides on a different node from the message queue, a copy of the message is forwarded to the appropriate node, the waiting task is unblocked, and the proxy used to represent the task is reclaimed.


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2008 OAR Corporation