Envoy ACP/XF Application Programming Manual
EnvoyACP/XF and the Application Task
EnvoyACP/XF Application Programming Manual–132179
1-11
WRITE, READ, and WRITEREAD Requests and
Nowait I/O
the next instruction or statement. An AWAITIO procedure call later in the program
logically completes such a call.
The EnvoyACP/XF bit-synchronous protocols queue all nowait READ, WRITE, and
WRITEREAD requests. Using basic control fields, your application can have up to 7
WRITE requests and 7 READ requests queued at any one time. Using extended control
fields, your application can have up to 127 READ or WRITE requests queued at any one
time. As part of each FILE_OPEN_ call, your application specifies the maximum
number of nowait I/O operations that can be pending at any one time. This number is
expressed as 4 bits in the flags parameter and therefore is limited to up to 15 nowait
operations for each FILE_OPEN_ call.
Remember that the window size, rather than the modulo or nowait depth, determines the
actual number of WRITE requests that can be pending at a given time. For example, if
you open a line that has nowait I/O greater than zero and you specify that up to 14
nowait I/O operations can be pending simultaneously, all the following combinations of
queued I/O requests are valid:
7 reads, 7 writes
5 reads
6 reads, 4 writes
2 reads, 2 writes
1 read, 5 writes
If you wanted to open a line using the extended control-field capability (the extended
control field is 2 octets long instead of the basic control-field length of 1 octet) and have
up to 120 READ and WRITE requests pending simultaneously, your application would
issue 8 FILE_OPEN_ calls that open the line for read-write use with each call specifying
a maximum of 15 concurrent nowait operations. All the FILE_OPEN_ also calls must
specify shared access. When subsequently using the line, you would handle all READ
calls by using one of these conventions:
•
Reserve one of the line openings for READ and/or WRITEREAD calls and use all
other openings only for WRITE calls.
•
Provide application-level frame sequencing within the data portion of all I-frames.
EnvoyACP/XF completes all queued READ operations in the order issued without
regard to the associated line openings. If you do not use one of the above conventions,
you might lose track of the proper frame sequencing at the application level.
Normally, when you use a single line opening, all READ, WRITE, and WRITEREAD
calls within your program are completed in the order you issue them. However, by using
a SETMODE 30 call, you can allow queued requests to complete in the same order in
which the I/O process completes them. This technique can be advantageous if you are
using full-duplex lines for Two-way Simultaneous transmission (TWS).
However, when you use SETMODE 30 calls with multiple line openings, READ,
WRITE, and WRITEREAD calls within your program complete in an arbitrary order.
Thus, you either must use tags or include frame sequencing within the data portion of
the I-frame.
To avoid using SETMODE 30 with multiple line openings, reserve one line opening for
READ requests and the remainder for WRITE requests. Then your application can