Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 64
Controlling the IPU Affinity of Processes
NAME^LENGTH,
OPTIONS);
Converting a Process Handle Into a Process String
To convert a process handle into a string, use the PROCESSHANDLE_TO_STRING_
procedure. This procedure is useful for producing a more readable output than that
produced by the PROCESSHANDLE_TO_FILENAME_ procedure, particularly for
unnamed processes. For example, a process file name returned by
PROCESSHANDLE_TO_FILENAME_ could be “$:2:137:987654321.” The equivalent
output from PROCESSHANDLE_TO_STRING_ would be “2,137.”
To use the PROCESSHANDLE_TO_STRING_ procedure, you must supply the
process handle in the processhandle parameter and return variables for the string
and string length in the pstring and pstringlen parameters.
The following example converts a process handle into a string:
LITERAL MAXLEN = ZSYS^VAL^LEN^FILENAME;
.
.
CALL PROCESSHANDLE_TO_STRING_(PROCESS^HANDLE,
PROCESS^STRING:MAXLEN,
STRING^LENGTH);
The above example returns either the process name if one exists or the CPU and PIN
if no name exists. The above example also places the system name at the beginning
of the output string.
Controlling the IPU Affinity of Processes
In multi-core CPUs, a process runs in a specific IPU of the CPU. The IPU to which a
process is assigned is referred to as the IPU affinity of the process. By default the IPU
affinity can be dynamically changed by the process scheduler for load-balancing or
responsiveness purposes. You can override this for a specific process, binding it to a
specific IPU via the IPUAFFINITY_SET_ procedure. The current IPU affinity of a
process can be obtained via the IPUAFFINITY_GET_ procedure.
The IPUAFFINITY_CONTROL_ procedure can be used to override the process
scheduler controls more generally to turn off dynamic load-balancing on all soft-affinity
processes (see the definition of "soft affinity" below) or on all DP2 processes in the
specified CPU.
The binding between IPUs and processes can only be done after the process is
created, as it is not a process creation option.