Guardian Procedure Calls Reference Manual

Interprocess Communication Considerations
Replying to messages
Each message read in a call to READUPDATE[X|XL], including system messages, must be
replied to in a corresponding call to the REPLY[X|XL] procedure.
Queuing several messages before replying
Several interprocess messages can be read and queued by the application process before a
reply must be made. The maximum number of messages that the application process expects
to read before a corresponding reply is made must be specified in the receive-depth
parameter to the FILE_OPEN_ or OPEN procedure.
If $RECEIVE is opened with receive-depth = 0, only READ[X]s can be performed, and
READUPDATE[X|XL] and REPLY[X|XL] fail with error 2 ("operation not allowed on this type
of file").
Message tags when replying to queued messages
If more than one message is to be queued by the application process (that is, receive-depth
> 1), a message tag that is associated with each incoming message must be obtained in a
call to the FILE_GETRECEIVEINFOL_ (or FILE_GETRECEIVEINFO_ or LASTRECEIVE or
RECEIVEINFO) procedure following each call to READUPDATE[X|XL]. To direct a reply back
to the originator of the message, the message tag associated with the incoming message is
passed to the system in a parameter to the REPLY[X|XL] procedure. If messages are not to be
queued, it is not necessary to call FILE_GETRECEIVEINFOL_ or FILE_GETRECEIVEINFO_.
Considerations for READUPDATEX and READUPDATEXL
The buffer and count transferred may be in the user stack or in an extended data segment.
The buffer and count transferred cannot be in the user code space.
If the buffer or count transferred is in a selectable extended data segment, the segment must
be in use at the time of the call. Flat segments allocated by a process are always accessible
to the process.
The size of the transfer is subject to current restrictions for the type of file.
If the file is opened for nowait I/O, and the buffer is in an extended data segment, you cannot
deallocate or reduce the size of the extended data segment before the I/O completes with a
call to AWAITIOX or AWAITIOXL or is canceled by a call to CANCEL or CANCELREQ or
CANCELREQL.
If the file is opened for nowait I/O, you must not modify the buffer before the I/O completes
with a call to AWAITIOX or AWAITIOXL. This also applies to other processes that may be
sharing the segment. It is the application's responsibility to ensure this.
If the file is opened for nowait I/O, and the I/O has been initiated with these routines, the
I/O must be completed with a call to AWAITIOX or AWAITIOXL (not AWAITIO).
If the file is opened for nowait I/O, a selectable extended data segment containing the buffer
need not be in use at the time of the call to AWAITIOX or AWAITIOXL.
Nowait I/O initiated with these routines may be canceled with a call to CANCEL or
CANCELREQ or CANCELREQL. The I/O is canceled if the file is closed before the I/O
completes or AWAITIOX or AWAITIOXL is called with a positive time limit and specific file
number and the request times out.
A file opened by FILE_OPEN_ uses direct I/O transfers by default except on NSAA systems;
you can use SETMODE function 72 to force the system to use an intermediate buffer in the
READUPDATE[X|XL] Procedures 1219