Guardian Programmer's Guide

Table Of Contents
Using Nowait Input/Output
Guardian Programmer’s Guide 421922-014
4 - 30
Nowait-Depth
In the following example, the call to the FILE_COMPLETE_ procedure waits for ten
seconds for a completion to occur on one of the files in the enabled set; the temporary
override set is not used.
?SOURCE ZSYSTAL( ZSYS^DDL^COMPLETION^INFO )
STRUCT .COMPLETE_INFO (ZSYS^DDL^COMPLETION^INFO^DEF);
INT(32) TIME_LIMIT;
INT ERROR;
.
.
TIME_LIMIT := 1000D; -- Wait for 10 seconds
ERROR := FILE_COMPLETE_ (
COMPLETE_INFO_ -- out; info on completed
file
,TIME_LIMIT -- in; time limit on
completion
);
IF ERROR <> 0 THEN ...
Nowait-Depth
The nowait-depth parameter is used by requesters when opening files.The nowait-
depth parameter tells the file system and the server the maximum number of I/O
requests that can be issued concurrently using the same file number.
The file system completes multiple requests against the same file in the exact order
issued, even if the reply for a request issued later physically arrives before the reply for
a previously issued request. SETMODE 30 enables the file system to complete I/O
requests in the order the server replies.
Nowait-depth value Description
0 Waited I/O. As soon as an I/O is initiated for this file, the process
is
suspended until the operation is completed.
1 No-waited I/O. Initiating the I/O operation does not suspend the
p
rocess. I/O operations must be completed using an AWAITIO
call. A nowait-depth value of 1 is the maximum value allowed
for $RECEIVE and disk files. If the application needs to issue
concurrent I/O on a disk file, open the file several times and issue
each no-wait request using a different file number.
> 1 (greater than 1) Concurrent no-waited I/O. Here, multiple concurrent I/Os are
s
upported over a single file open. To track the different I/Os, the
requester must assign each I/O a unique tag that is returned to
the requester when the operation is completed. Although the file
system supports nowait-depth value in the range 0 through 15,
many devices and processes do not support open requests with a
nowait-depth value greater than 1.