6100 ADCCP Programming Manual

ADCCP Programming Example Using Transaction Application Language (TAL)
B–2 069225 Tandem Computers Incorporated
This example runs as a process pair. These definitions are used in the
implementation of fault tolerance.
int backupcrtpid[0:4], !process id of backup
thiscpu,
backupcpu,
create^back := 0,
go^back := 0,
go^prime := 0;
int session; !session is not checkpointed - on take over
!start a new session
int records^read,
records^written;
Every 30 seconds this program prints a message on the home terminal to indicate
how many data frames were sent and received.
!
!The following time variables are for determining
!when 30 seconds has passed
!
int start^time[0:2];
int(32) start = start^time[1];
int now^time[0:2];
int(32) now = now^time[1];
!
!From this point on, the global stack is
!checkpointed. NonStop:
!
int error := 0,
SERROR := 0,
exp^cnt, !the tag for the read frame
first^time, !flag to indicate first time reads
!are posted
do^sabm, !TRUE = SABM FALSE = DISC^ONLINE
!(wait for SABM)
startup^pri^sec^parm,
startup^says^sabm,
i,
INTTAG, !INTEGER VERSION OF INT(32) VARIABLE TAG
count^trans,
sav^error,
io^count,
count^read,
fnum^error,
total^length := 80,
base = error, !base for checkpoints
suppress^length,
suppress^count,
recname [0:11] := ["$RECEIVE",8*[" "]],
framesize,