This section describes ACCENT R’s support of OpenVMS global memory section. Global Sections can be created for system-wide access or be limited to group access. They can be created as temporary or permanent section. Global Sections are useful for sharing needed data between processes. Creating Global Sections in ACCENT R is much easier than doing it with a 3rd Generation Language (3GL).
Privileges are needed to use system-wide global section. These can be obtained through the set command in the OpenVMS Digital Command Language (DCL):
$ SET PROC/PRIV=(options)
The options include:
ALL (all privileges available)
PRMGBL (create a PERM/anent/ global section, either group or system)
SYSGBL (create a system-wide global section)
EXAMPLE: $ SET PROC/PRIV=(PRMGBL, SYSGBL)
NOTES: The parentheses are only needed if multiple options are specified. A temporary group global only requires normal defaults (SET command is not needed). User must be authorized to use certain options.
To cancel privileges, log out and then back in again, or use the same syntax with the prefix of “NO” as part of each option.
$SET PROC/PRIV = (NOSYSGBL, NOPRMGBL)
$SET PROC/PRIV = NOALL
To see privileges currently set enter: $SHOW PROC/PRIV
Global Sections are created within ACCENT R with the USE GS statement. The complete syntax is:
*USE GS \\ gs_name [AS [PERM/ANENT/] {PROCESS; GROUP; SYSTEM} GLOBAL/SECTION/]
NOTES: If the “AS GLOBAL” clause, is not specified then there is no sharing between users. It is possible that two users might NOT share the same GS depending on which privileges were enabled for each. One user may get a group-wide global and the other may get a system-wide global. Therefore, care must be taken when declaring privileges.
An error in creating a Global Section will set @ERROR_NUMBER to 226. An error message is also displayed: “Insufficient privileges enabled to complete specified action.
Global sections can be deleted with the CANCEL option in the USE GS statement.
*USE NO GS [\\ [gs_name] [CANCEL]\\]
The CANCEL option does a number of operations:
un-maps a global section (GS) from the user’s process virtual memory;
subtracts 1 from the system’s “reference count” of a shared global section;
marks a permanent (group or system-wide) GS for deletion.
NOTES: If other users have the GS mapped into their virtual address space, it will NOT be removed from the system. The references count must drop to zero before a GS will be deleted.
To display the state of the actual global sections, one MUST use the program in “command mode. The procedure is:
$ INSTALL :==$SYSTEM:INSTALL/COMMAND_MODE
$ INSTALL
INSTALL> LIST/GLOBAL
This lists all global sections in use. Group Global Sections are listed after to system-wide Global Section. The “LIST/GLOBAL” command can be used by even a non-privileged user.