Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (C)
Guardian Procedure Calls Reference Manual522629-013
3-62
CHECKPOINTX Procedure
Use $LEN or an equivalent language function to determine the length of data
items, and use this value in the
count-n parameter. The lengths of some
data items differ between a native process and a TNS process.
When checkpointing a set of global variables, if the set is small enough, you can
obtain their address and size using the PROCESS_GETINFOLIST_ procedure,
items 108 and 109.
Code that will only be run as a TNS process can use constants for addressing
global variables and assume adjacency of global and local variables.
Do not checkpoint heap or pool storage
Native processes can use a standard heap area for dynamic memory allocation;
programs using the Common Run-Time Environment (CRE) make this heap
available, for example, by using the C
malloc() function. A TNS process can
achieve a similar effect with a flat segment that has space structured as a standard
memory pool.
Process pairs should not checkpoint data residing in the heap or memory pool.
Control information is needed to maintain structure, and this control information
can be neither obtained nor checkpointed. If the backup process were to take over
using checkpointed heap or pool data, its heap or pool would be corrupt and
allocations and deallocations would not work. Not only would the space control
information be corrupt, but the backup typically would not even have underlying
memory allocated at the needed address to receive the data at the time of the
checkpoint.
Checkpoint message size limit
The largest stack area or data item that can be checkpointed is 32,500 bytes.
Additionally, the sum total of the sizes of the stack area and each checkpoint item,
plus an allowance of 20 bytes for each item, should not exceed 32,500 bytes. An
item in this context means either a data item (user-declared size) or a file
synchronization block with varying sizes.
For native processes, the size of the checkpoint message sent to the backup
process is limited to 50,000 bytes. This additional message capacity is necessary
because of increased data memory requirements.
The extra space in a checkpoint message for a native process enables TNS
process pairs to be converted to native processes and allows a program to be
compiled for either environment.
If the address is in an extended data segment, the backup must also have that
extended data segment allocated. The backup must have the same segment ID,
and the segment should be the same size. If the backup has a smaller size, any
data in the primary process that is outside of the addressable area of the segment
in the backup process is not checkpointed. If the backup process does not have a
segment with that segment ID, an error is returned and no data or file information
is checkpointed.