Guardian Programmer's Guide

Table Of Contents
Using Nowait Input/Output
Guardian Programmer’s Guide 421922-014
4 - 10
Applying Nowait Operations to Multiple Files
Applying Nowait Operations to Multiple Files
Your program may open several files for nowait I/O and issue one or more I/O
operations against each file. (Some kinds of opens, for example those of disk files,
allow only one operation at time.) Figure 4-3 shows how nowait operations can occur
concurrently on multiple files.
When nowait I/O operations are applied to multiple files, you cannot predict the order in
which the operations will finish. In Figure 4-3, the first and third write operations are to
the same files, therefore the first write will finish before the third write. The second
write is to a different file; therefore it is not clear when it will finish with respect to the
first and third writes.
To allow completion of a nowait operation to any file, you use the AWAITIO[X]
procedure in a way that responds to the first completed I/O, regardless of the file that
the I/O operation was made against. You do this by setting the file-number
Figure 4-3. Nowait Operations on Multiple Files
VST022.VSD