Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 42
Waiting for Any File
15 Using the Sequential Input/Output Procedures
Waiting for Any File
You can use SIO procedures to concurrently apply nowait I/O to multiple files. In other
words, you can issue nowait I/O operations against more than one file and then wait for
any of the I/O operations to finish.
Here, you need to use the AWAITIO procedure as well as the WAIT^FILE procedure to
complete the I/O operation. The AWAITIO procedure responds to the first I/O to finish,
and then the WAIT^FILE procedure updates the file-state information. Figure 15-4
shows this model (excluding calls to the WAIT^FILE procedure).
A typical use for concurrent nowait operations is in a process that communicates with
more than one terminal. The process can issue prompts to several users without
having to wait for a reply. Instead, the process can continue processing requests from
active users. An inactive user can become active again simply by responding to the
prompt.
The important steps are outlined as follows:
1. Open each file for nowait I/O using the OPEN^FILE procedure with the NOWAIT
flag set. This step is the same as for the single-file model, except that you need to
do it once for each file.
2. Establish the file numbers of each of the open files. Nowait I/O applied to multiple
files is one of the few occasions when you would mix SIO procedures with regular
Figure 15-4. Nowait I/O Applied to Multiple SIO Files
VST075.VSD