GDSX Manual

DEVICE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual134303
5-22
Testing Failure at a ^WRITEREAD
If ^CHECKPOINT is called with type equal to 1, only the task’s stack image is
checkpointed to the backup. If the procedure is called with type equal to 2, the stack
image plus any memory pool buffers allocated by the task are checkpointed to the
backup process. Therefore, because this example calls ^CHECKPOINT(2), after
takeover the receiving buffer (rcv^buf) allocated from the buffer pool will be available.
Figure 5-6. Fault Tolerance in the DEVICE^HANDLER Example
@RCV^BUF :=
GETEXTPOOL (...
TAKEOVER :=
FALSE
^READUPDATEX
(PSEUDO-$RCV, ...
ANALYZE
REQUEST TYPE
^REPLYX
WHILE (1)
DO
^CHECKPOINT(2)
TAKEOVER :=
TRUE
^RECLAIMBUFFER
(@E^RCV^BUF,10)
TAKEOVER?
TAKEOVER
NORMAL
WTRD
FALSE
^WTRDX TERM^WTX TERM
CDT011
WT
TRUE