GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-57
Q^CP[X]
Q^CP[X]
Once a task calls GET^CPSEM to obtain the checkpoint semaphore, the task can call
Q^CP[X] to copy user-defined data to the TSCODE checkpoint buffer in preparation for
a call to DO^CP or ^CHECKPOINT, either of which copies the buffer to the backup
process.
The Q^CP procedure moves global data within a user’s named or private global data
block to the checkpoint buffer located in extended memory. The Q^CPX procedure
moves extended memory data to the checkpoint buffer. Up to four data areas can be
moved to the checkpoint buffer with a single call to Q^CP[X].
Multiple calls to Q^CP[X] can be done before calling DO^CP or ^CHECKPOINT.
Q^CP[X] queues data until the number of words in the checkpoint buffer, including
three control words per data area copied, exceeds the size set by the MAXCPSIZE
configuration parameter.
If the checkpoint buffer overflows during a call to Q^CP[X] from the USER^BACKUP
exit, TSCODE automatically writes the current checkpoint buffer to the backup process.
status returned value
INT:value
Caution. If the checkpoint buffer overflows or the maximum checkpoint size is reached during
a call to Q^CP[X] from a user exit other than USER^BACKUP, the backup process is
terminated and Q^CP[X] returns 0. To prevent this, ensure that MAXCPSIZE is large enough
(the default size is 4,096 words). If the backup process is terminated, it is still the callers
responsibility to release the semaphore with GIVE^CPSEM.
Caution. If a task owning one or more semaphores stops, the primary GDSX process stops.
If a task owning one or more semaphores faults with the noretn parameter of FAULT equal to 1,
the primary GDSX process stops.
Caution. It is recommended that you use ^CHECKPOINT(2) instead of Q^CPX and DO^CP to
checkpoint extended memory buffers. Because DO^CP checkpoints directly across to the
backup process, using Q^CPX and DO^CP to checkpoint extended memory buffers works only
for pool areas allocated in exactly the same area of memory in both the primary and the
backup.
status := Q^CP[X] ( data1 !
i
,bytes1 !
i
,[ data2 , bytes2 ]
,[ data3 , bytes3 ]
,[ data4 , bytes4 ] );