Exchange/SNA Manual

Programming Considerations
Using the Exchange/SNA Programmatic Interface
4–4 104700 Tandem Computers Incorporated
Advantages and Disadvantages
An important decision in the design of any program is the choice between wait and
nowait I/O operations. Each file used by your program can be opened for wait or
nowait I/O operations. A single program can perform nowait I/O operations on some
files while performing wait I/O operations on other files.
Advantage of Wait I/O. The advantage of wait I/O operations is their simplicity. They
are easy to design and code. Wait I/O operations do not require the calls to
AWAITIO, and they do not require any code to keep track of multiple outstanding
I/O operations.
Disadvantage of Wait I/O. The disadvantage of wait I/O operations is that your program
cannot do anything while an I/O operation is in progress. This is a disadvantage only
if some useful work can be done while the I/O operation is in progress. For example,
if your program waits for a user to enter a command from a terminal, it may not make
sense to use nowait I/O operations with the terminal because your program does not
know what to do until the user enters the command. In this case, no useful work can
be done while the I/O operation is in progress.
Advantage of Nowait I/O. The advantage of nowait I/O operations is performance. They
allow your program to perform useful work while I/O operations are in progress. A
typical use of nowait I/O operations is to perform overlapping, concurrent I/O
operations. While an I/O operation is in progress on one file, your program can
initiate another I/O operation on another file. In this way, both I/O operations can be
in progress at once, which can sometimes result in better performance for your
program overall.
Disadvantage of Nowait I/O. The disadvantage of nowait I/O operations is that they
introduce complexity into your program that may not be required by the task to be
performed. Nowait I/O operations require calls to AWAITIO that are not required by
wait I/O operations, and nowait I/O operations can require code to keep track of
multiple outstanding I/O operations. Moreover, the calls to AWAITIO must be
incorporated into your program in such a way that they synchronize the execution of
your program with the completion of the outstanding nowait I/O operations. For
example, if your program is using nowait I/O operations to send a file to a host
system through a subdevice supported by the Exchange/SNA line server, you do not
want to write the next record to the subdevice until the nowait I/O operation that
reads that record from the file has completed.