diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-000ACB11-EDD0-5160-BC5E-4593F1BAF293.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-000ACB11-EDD0-5160-BC5E-4593F1BAF293.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,64 @@ + + + + + +Message +Queue OverviewThis topic describes the message queue overview. +

A message queue is a mechanism for passing data:

+ +

The mechanism provides a way to send data (messages) to an interested party +without needing to know whether anyone is listening nor needing to know the +identity of a recipient.

+

A message is an object, usually an instance of a class, that is placed +into a queue for delivery to recipients. A queue is normally created to deal +with messages of a given type. This means that a queue is created to deal +with messages of a defined (fixed) length. The size of a queue, i.e. the maximum +number of messages, or slots, it can contain is defined and fixed when the +queue is created. The size of message for which a queue is created, and the +size of the queue is arbitrary, being limited only by system resources.

+

A single queue can be shared by many readers and writers. Several threads +may be reading from and writing to the same message queue, but only one thread +can access the queue at a time. If multiple clients attempt to read from the +message queue a panic will be raised.

+

A message queue is represented by a DMsgQueue kernel side +object, to which the reader and the writer can open a handle, a RMsgQueue object. +A message queue is a reference counted object, being derived from CObject, +which means that it is not persistent; it is deleted when the last handle +to it is closed. The queue itself is simply a block of memory divided into +slots, managed by the DMsgQueue object.

+ + + +
Handle to a +message queue

A message queue is created, opened, written to and +read from through a message queue handle, an RMsgQueue object. +This is a templated class, where the template parameter defines the message +type.

RMsgQueue is derived from RMsgQueueBase, +which together form a thin template class/base class pair. RMsgQueueBase provides +the implementation, while RMsgQueue provides type safety. +An RMsgQueueBase object is a valid message queue handle, +but does not offer the type safety that RMsgQueue does.

+ +

Message queues are used for one-way, one to one communications only. +The message queue is therefore unicast. If there are multiple readers of the +message queue only one will receive the message.

+
Visibility +of a message queue

A message queue can be:

    +
  • named and be visible +to all processes - a global queue

  • +
  • local to the current +process, i.e. not visible to any other process - a local queue

  • +
+
\ No newline at end of file