1 | .. SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) |
---|
4 | |
---|
5 | Message Queue Buffer Configuration |
---|
6 | ================================== |
---|
7 | |
---|
8 | This section describes the configuration parameters related to specifying the |
---|
9 | amount of memory reserved for message queue message buffers. See |
---|
10 | :ref:`CONFIGURE_MAXIMUM_MESSAGE_QUEUES` and |
---|
11 | :ref:`CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES`. |
---|
12 | |
---|
13 | .. index:: CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
14 | .. index:: configure message queue buffer memory |
---|
15 | |
---|
16 | .. _CONFIGURE_MESSAGE_BUFFER_MEMORY: |
---|
17 | |
---|
18 | CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
19 | ------------------------------- |
---|
20 | |
---|
21 | CONSTANT: |
---|
22 | ``CONFIGURE_MESSAGE_BUFFER_MEMORY`` |
---|
23 | |
---|
24 | DATA TYPE: |
---|
25 | integer summation macro |
---|
26 | |
---|
27 | RANGE: |
---|
28 | undefined (zero) or calculation resulting in a positive integer |
---|
29 | |
---|
30 | DEFAULT VALUE: |
---|
31 | This is not defined by default, and zero (0) memory is reserved. |
---|
32 | |
---|
33 | DESCRIPTION: |
---|
34 | This macro is set to the number of bytes the application requires to be |
---|
35 | reserved for pending Classic API Message Queue buffers. |
---|
36 | |
---|
37 | NOTES: |
---|
38 | The following illustrates how the help macro |
---|
39 | :ref:`CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE` can be used to assist in |
---|
40 | calculating the message buffer memory required. In this example, there are |
---|
41 | two message queues used in this application. The first message queue has |
---|
42 | maximum of 24 pending messages with the message structure defined by the |
---|
43 | type ``one_message_type``. The other message queue has maximum of 500 |
---|
44 | pending messages with the message structure defined by the type |
---|
45 | ``other_message_type``. |
---|
46 | |
---|
47 | .. code-block:: c |
---|
48 | |
---|
49 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ |
---|
50 | (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \ |
---|
51 | 24, sizeof(one_message_type) \ |
---|
52 | ) + \ |
---|
53 | CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \ |
---|
54 | 500, sizeof(other_message_type) \ |
---|
55 | ) |
---|
56 | |
---|
57 | .. index:: CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE |
---|
58 | .. index:: memory for a single message queue's buffers |
---|
59 | |
---|
60 | .. _CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE: |
---|
61 | |
---|
62 | CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE |
---|
63 | ----------------------------------- |
---|
64 | |
---|
65 | CONSTANT: |
---|
66 | ``CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per)`` |
---|
67 | |
---|
68 | DATA TYPE: |
---|
69 | Unsigned integer (``size_t``). |
---|
70 | |
---|
71 | RANGE: |
---|
72 | Positive. |
---|
73 | |
---|
74 | DEFAULT VALUE: |
---|
75 | The default value is None. |
---|
76 | |
---|
77 | DESCRIPTION: |
---|
78 | This is a helper macro which is used to assist in computing the total |
---|
79 | amount of memory required for message buffers. Each message queue will |
---|
80 | have its own configuration with maximum message size and maximum number of |
---|
81 | pending messages. |
---|
82 | |
---|
83 | The interface for this macro is as follows: |
---|
84 | |
---|
85 | .. code-block:: c |
---|
86 | |
---|
87 | CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per) |
---|
88 | |
---|
89 | Where ``max_messages`` is the maximum number of pending messages and |
---|
90 | ``size_per`` is the size in bytes of the user message. |
---|
91 | |
---|
92 | NOTES: |
---|
93 | This macro is only used in support of :ref:`CONFIGURE_MESSAGE_BUFFER_MEMORY`. |
---|