Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 34
Specifying Process Attributes and Resources
PROCESS_LAUNCH_ procedure are unused except for information purposes (that is,
to support programs that use the swap file name to determine the volume on which to
create temporary files). The actual swap space is handled by the Kernel-Managed
Swap Facility (KMSF), regardless of whether these fields are used.
If your TNS process uses a default extended data segment, you can use the
EXTSWAPFILE_NAME and EXTSWAPFILE_NAME_LEN fields of the input parameter
structure of the PROCESS_LAUNCH_ procedure to specify a swap file for that
segment. (These fields are ignored for TNS/R native processes.) Specifying a swap
file for a TNS process in this manner is supported for compatibility, but it is not
recommended. For best performance, you should allow the system to use KMSF to
manage swap space.
Requesting Guarantee of Swap Space From KMSF
Most swap space is handled by the Kernel-Managed Swap Facility (KMSF). For each
CPU, KMSF manages one or more swap files from which swap space is allocated for
the processes in that CPU.
A process is automatically allocated swap space by KMSF as needed. However, if you
want to ensure that a particular amount of swap space is available for your process,
you can specify a value (other than 0) in the SPACE_GUARANTEE field of the input
parameter structure when calling PROCESS_LAUNCH_. (You can also set the space
guarantee value using the nld utility; refer to the nld and noft Manual. However, you
cannot set this attribute in a TNS object file.) KMSF reserves the amount of space
specified in this field, in bytes, as swap space for the new process. The number of
bytes is rounded up to the page size of the CPU.
The space guarantee applies to space allocated for the stack, the globals-heap
segment, and any SRL data segments; it does not apply to space for extended data
segments. (For information on allocating space for an extended data segment, refer to
Allocating Extended Data Segments in Section 17, Managing Memory.) If KMSF
cannot guarantee the amount of space requested, PROCESS_LAUNCH_ returns error
55.
Most processes do not need to set the space guarantee attribute, because KMSF
allocates space as processes need it. Setting large guarantees on many processes
could have a detremental effect on swap space consumption. The guarantee
mechanism is provided for programs (such as some NonStop process pairs) that need
to ensure, when starting, that they will not later fail due to competition for resources.
For more information about KMSF, refer to the Kernel-Managed Swap Facility (KMSF)
Manual.
The following example specifies that 262,144 bytes of swap space (equivalent to two
segments) be reserved.
.
.
PARAM_LIST.SPACE_GUARANTEE := 262144D;
ERROR := PROCESS_LAUNCH_( PARAM_LIST,