6100 ADCCP Programming Manual
ADCCP Programming Example Using Transaction Application Language (TAL)
B–8 069225 Tandem Computers Incorporated
The next few procedures are part of the implementation of fault tolerance.
!Procedure to stop the backup process.
!
proc stop^backup;
begin
if backupcrtpid then call stop(backupcrtpid);
return;
end;
!
!Crashing - fire off a flare before doing so.
!
proc abend^;
begin
int p;
p := p[-3]; !pickup return address
call stamp^msg(sbuf);
sbuf[9] ':=' "___ ABEND at P = %" -> @ptr;
call numout(ptr,p,8,5);
call write(outfile,outbuf,@ptr '-' @outbuf'<<'1 '+' 5);
call awaitio(outfile);
backupcrtpid[3] := -1; !signal to stop the process pair
call stop^backup; !this call will kill us, but if
!it does not then -
call abend; !crash and burn
end;
?PAGE "NONSTOP HELPERS"
proc check(base);
int .base;
forward;
!
!Find Backup CPU Procedure
!
int proc select^backup(backup^cpu);
int .backup^cpu;
begin
int(32) cpu^info;
int prime^cpu,
found^cpu := false,
num^cpus = cpu^info,
cpu^stat = cpu^info+1;
cpu^info := processorstatus;
backup^cpu := num^cpus;
prime^cpu := mypid.<0:7>;
while true do
if prime^cpu <> backup^cpu and ((%h8000 '>>' backup^cpu) land cpu^stat) then return true
else if (backup^cpu := backup^cpu - 1) < 0 then return false;
end;
?page "recvtext to flush reads and LTF^START on CHECKOPEN"