Tunable Kernel Parameters

Table Of Contents
Interprocess Communication (IPC) Subsystem
Overview of Message Queue Operations
Chapter 5
35
Overview of Message Queue Operations
See “Message Parameter Summary” on page 32 for the list of parameters.
Messages
Messages are small collections of data (400 bytes, for example) that can be passed
between cooperating programs through a message queue. Messages within a queue can
be of different types, and any process with proper permissions can receive the messages.
A receiving process can retrieve the first message, the first message of a given type, or
the first message of a group of types. See msgop (2) for more information.
Message Queues
Message queues are implemented as linked lists of data stored in shared memory. The
message queue itself contains a series of data structures, one for each message, each of
which identifies the address, type, and size of the message plus a pointer to the next
message in the queue.
To allocate a queue, a program uses the msgget() system call (see msgget (2)). Messages
are placed in the queue by msgsnd() system calls and retrieved by msgrcv() (see
msgop(2)). Other operations related to managing a given message queue are performed
by the msgctl() system call (see msgctl (2)).
For information about using messages in programs, refer to an advanced UNIX
programming text such as Advanced UNIX Programming by Marc J. Rochkind,
Prentice-Hall, Inc., ISBN 0-13-011800-1.
Message and Message Queue Management
Message queues and the message header array are located in (swappable) shared
memory space. Other data structure arrays necessary for managing them are located in
the (nonswappable) kernel space.
Kernel configuration parameters for messages control:
Maximum number of message queues on system,
Maximum message queue size,
Maximum message length,
Maximum total combined length of messages in a queue,
Maximum number of messages per queue,
Maximum number of simultaneous messages system-wide,
Maximum size of message header list,
Maximum size of free-space map for locating new messages.
IPC messages require the following memory space allocations:
Space in the kernel area for message identifiers.
Shared memory space for message queues.
Shared memory space for message headers.