Training
×

Mailbox Queues

A mailbox has two queues of which at least one will be empty (the kernel ensures that a message is not queued but delivered immediately when a thread is already waiting, and reversed, does not queue a thread when a message is already queued).
The thread queue holds the handles of threads that are waiting to receive information from the mailbox. The thread queue can be FIFO or arranged in order of thread priority, with better priority threads toward the head of the queue.
The data queue (for a data mailbox) or object queue (for an object mailbox) contains information that is waiting to be received from the mailbox. This queue is always FIFO so messages or objects will be retrieved from the mailbox in the same order in which they were sent.
An initial data or object queue is created when the mailbox is created. The initial size of the data queue for data mailboxes is fixed at 400 bytes (enough for three 128-byte messages). The initial size of the object queue for object mailboxes can be specified.
If the data or object queue overflows, the INtime kernel automatically creates another buffer; these overflow queues are deleted when the data or objects have been received.
NOT TO BE CONFUSED WITH MESSAGE QUEUEs, a different  IPC type (later).