Guardian Programmer's Guide

Table Of Contents
Introduction to Guardian Programming
Guardian Programmer’s Guide 421922-014
1 - 8
Process Management
Process Management
The Guardian procedures provide you with the ability to create and manage processes,
including the ability to allocate process resources such as the CPU in which the
process will run.
One of the distinguishing features about the operating system is the ability of the
system to withstand failures without stopping the application. The Tandem Pathway
and TM/MP products provide functions that make some types of applications tolerate
system failures; the Pathway and TM/MP manuals provide details. The operating
system supports the concept of process pairs for withstanding the failure of the CPU in
which the application process is running.
A process pair is two executions of the same program, coordinated so that one
process acts as backup to the other process. Each process runs in a different CPU.
Logic within the program determines which process is the primary and which is the
backup. If there is a failure in the CPU in which the primary process is running, then
the backup process can take over from the primary.
The reason that the backup process is able to take over from the primary is that the
program is coded to pass checkpointing messages to the backup process from the
primary, thus keeping the backup process continually aware of the executing state of
the primary process. If the backup process receives notification that the CPU of the
primary process has failed, then the backup process assumes the role of the primary
process and continues executing the application. The end user of the application
remains unaware of any failure.
Section 16, Creating and Managing Processes, describes how to create and manage
simple processes.
Memory Management
The operating system manages virtual address space. The organization of space for
user data differs for TNS/R native processes and TNS processes. (Refer to “TNS/R
Program Execution Modes,” later in this section, for descriptions of TNS/R native
processes and TNS processes.)
TNS/R native processes have a main stack and a priv stack. A native process also
has a globals-heap segment, which contains global data and, optionally, a heap. The
main stack and the heap grow automatically as needed, up to a maximum size. The
maximum size of each can be specified when a process is created. The default limit
for the main stack is 1 megabyte; the default limit for the heap is 32 megabytes.
TNS processes have a user data segment, which is typically 128 KB in size. The first
64 KB of the user data segment contains global data and the user data stack. The
remaining 64 KB is also available for use, but TAL and pTAL programs must manage
the space themselves. The Common Run-Time Environment (CRE) manages that
area for programs in other TNS languages.