User guide

118 DC 900-1338I
Protocol Software Toolkit Programmer Guide
7.2 Queue Elements
In general, a queue element consists of one or more linked buffers, and a queue can
contain one or more linked queue elements. Every buffer of a queue element contains a
standard system buffer header, as defined in the OS/Impact Programmer Guide. A field
in each buffers header is used as a link to the next buffer of the queue element. Two
fields in the header are valid only in the first buffer of a queue element. One field is a
link to the next element on a queue and the other, if the queue is doubly linked, is a link
to the previous element.
A buffer can be obtained from a system partition (using the get buffer,
s_breq, system
call), but this is not a requirement. Any block of memory large enough to contain a sys-
tem buffer header can be used as a buffer (for example, a fixed data structure defined
within an ICP-resident application). There is no maximum buffer size, no maximum
number of buffers in a queue element, and no maximum number of queue elements
attached to a queue.
Figure 71 shows a singly-linked sample queue containing three queue elements.
Figure 72 shows a doubly-linked sample queue containing three queue elements.