GDSX (Extended General Device Support) Manual
Design and Development
Extended General Device Support (GDSX) Manual—529931-001
2-33
Checkpointing
to send the data to the backup process. The call to ^CHECKPOINT establishes a
restart point at the instruction following the call.
Note that this example synchronizes the checkpointed globals with the state of the
calling task, but does not guarantee that the globals will be synchronized with the
states of other tasks. Synchronization of the globals with other tasks depends on the
application’s design.
For example, suppose task A checkpoints a global list and its stack image and then
adds item x to the global list. Then task B adds item y to the list and checkpoints the
global list and its stack image. If there is a takeover, item x is included in the list, but
task A tries to add it again.
Type 1 Checkpoint
When a user task does a type 1 checkpoint, the following actions occur. Note that
before CHECKPOINT(1) is called by a task, global data may have been put in the
checkpoint buffer by call(s) to Q^CP[X].
1. The semaphore cpsem is acquired.
2. The task’s stack image and TCB are placed at the next available word in the
checkpoint buffer. (Global data may have previously been queued in the buffer.)
3. The checkpoint buffer is written to brother.
4. The semaphore cpsem is released.
When the backup process receives the checkpoint message, any global data included
is copied to the same address in the backup. The checkpointing task’s stack image is
copied to an extended memory area of size specified by the TASKSIZE configuration
parameter. The backup copies the checkpointed portion of the TCB to the appropriate
location in the TCB pool.
Type 2 Checkpoint
A call to ^CHECKPOINT(2) checkpoints all local and extended memory pool buffers
acquired by the calling task. If USCODE has allocated an extended segment (with an
ID in the range from 0 to 1023) through calls to ALLOCATESEGMENT and
USESEGMENT, such a segment is not checkpointed with a call to ^CHECKPOINT(2).
When a task does a type 2 checkpoint, the following actions occur. Note that before
CHECKPOINT(2) is called by a task, global data may have been put in the checkpoint
buffer by call(s) to Q^CP[X].
1. The semaphore cpsem is acquired.
2. All memory pools are searched and all areas owned by the task are copied into the
extended memory area with address tcb.buffers.