Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (O)
Guardian Procedure Calls Reference Manual522629-013
11-20
OPEN Procedure (Superseded by FILE_OPEN_
Procedure )
! second open on file MYFILE.
.
.
OPEN( MYFILE , filenumc ... );
! third open on file MYFILE.
.
----
d .
e LOCKFILE ( filenumb, ... ); ! the file is locked
a . ! using the file number
d . ! associated with the
l . ! second open.
o READUPDATE ( filenumc, ... ); ! update the file
c . ! associated with the
k . ! third open.
----
Locks are granted on an open file (that is, file number) basis. Therefore, if a
process has multiple opens of the same file, a lock of one file number excludes
access to the file through other file numbers. The process is suspended forever if
the default locking mode is in effect.
You now have a deadlock. The file number referenced in the LOCKFILE call
differs from the file number in the READUPDATE call.
Limit number of times file can be open
There is a limit to the total number of times a given file can be open at one time.
This determination includes opens by all processes.
The specific limit for a file is dependent on the file’s device type:
Disk Files Cannot exceed 32,767 opens per disk
Process Defined by process (see discussion of “controlling openers” in the
Guardian Programmer’s Guide)
$0 Unlimited opens
$0.#ZSPI 128 concurrent opens permitted
$OSP 10 times the number of subdevices (up to a maximum of 83
subdevices)
$RECEIVE One open per process permitted
Other Varies by subsystem
Nowait opens—errors
If a process file is opened in a nowait manner (
flags.<8> = 1), that file is opened
as nowait and checkopened in a nowait manner. Errors detected in parameter
specification and system data space allocation are returned by the call to OPEN,
and the operation is considered unsuccessful. If there is an error, no message to
the process being opened is sent, and no call to AWAITIO is needed to complete
the open.