GDSX (Extended General Device Support) Manual

Design and Development
Extended General Device Support (GDSX) Manual529931-001
2-32
Checkpointing
Each checkpoint record is structured as:
For example, to checkpoint a file, TSCODE uses the following record:
Word 0 23
Word 1 3
Word 2 Address of associated FCB
Words 3–10 FCB
Words 11–22 File name
Upon receiving this checkpoint message, brother compares the message with its FCB.
(The FCB is logically structured into two parts: noncheckpointed and checkpointed.
While the primary GDSX process actually passes the entire FCB to its backup, the
backup copies only the checkpointed portion to the appropriate location in the FCB
pool.) If the message indicates that the file is in the same state (open or closed) in the
primary and backup processes, no action is taken. If the state is not the same, brother
opens or closes the file as appropriate. (In case brother cannot open the file, it replies
to the primary with a file number and the Guardian file error number returned from
OPEN. The primary issues an appropriate message and stops the backup process.)
Checkpointing User Global Data
Checkpoints including both global data and task stack are accomplished by the
following technique:
INT I^GOT^CP^SE M;
I^GOT^CP^SEM := GET^CPSEM;
CALL Q^CP(...); !As many as required to checkpoint globals
IF ^CHECKPOINT( ) THEN ! either type 1 or type 2
BEGIN
I^GOT^CP^SEM := 0;
.
Do takeover processing
.
END
ELSE
IF I^GOT^CP^SEM THEN
BEGIN
CALL GIVE^CPSEM;
I^GOT^CP^SEM := 0;
END;
Q^CP queues the global data in the checkpoint buffer (of size MAXCPSIZE). The call
to ^CHECKPOINT is used to queue the task’s stack image and TCB (and the task’s
allocated memory pool buffers if it is a type 2 checkpoint) in the checkpoint buffer and
Word 0 Size of checkpoint record in words (m)
Word 1 Type of checkpoint record
Word 2 Address of entity being checkpointed
Words 3m-1 Checkpoint data