GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-63
^RECLAIMBUFFER
If sysmsgs^flag of the CONTROLFLAGS configuration parameter is set to 1 and you
call ^RECEIVEINFO after a close message is received, the file number returned is
always 0.
With the use of the iotype parameter, it is possible for USCODE to differentiate between
READ, WRITE, and WRITEREAD operations from the application.
The syntax, condition code settings, and considerations regarding this procedure are the
same as the counterpart in the Guardian Procedure Calls Reference Manual.
^RECLAIMBUFFER
When a task has done a type 2 checkpoint (^CHECKPOINT(2)) and the backup takes
over, it is necessary for the task to recover its memory pool buffer images by calls on
^RECLAIMBUFFER. This procedure allows a task to reallocate memory buffers for
any of the six memory pools after a takeover.
Because the user tasks share the memory pools and would overwrite each other’s data if
they were allowed to checkpoint directly across to corresponding memory pool
addresses for the backup process, pool buffers are checkpointed to a section of the
backup process’s extended memory where each task has a separate, TASKCPSIZE-sized
area for checkpointing. Therefore, in the event of a takeover, any memory pool buffer
addresses that the task has stored in its data stack are no longer valid.
A task recovers its buffer images by calls on ^RECLAIMBUFFER. This procedure is
passed, by reference, the word pointer to the data as it was allocated in the primary
process. The task’s last checkpoint block in the former backup’s extended memory is
searched for an address match. When one is found, space in the specified buffer pool is
allocated and the data image is copied. Finally, the word pointer in the task’s stack is
updated to point to the new location of the data.
buffer input, output
INT(32):ref
on input, is a pointer to a buffer that you specify is to be reallocated after a takeover.
For extended memory buffers, the address of the pointer must be passed, for
example, @BUF. For local buffers, pass the buffer address as converted by the TAL
procedure $XADR. See the examples later in this subsection.
Caution. Following a takeover, if a task does not recover all its buffer images before it does a
type 2 checkpoint, those buffers not reclaimed are lost.
Caution. In the USER^TAKEOVER procedure you cannot remap buffers allocated in the
former primary process (which existed before the takeover) by calling ^RECLAIMBUFFER,
because each active user task must reclaim its own buffers, and no user task is active during
execution of USER^TAKEOVER.
CALL ^RECLAIMBUFFER ( buffer !
i,o
,[ pool-number ] ); ! i