Guardian Procedure Calls Reference Manual
CHECKSWITCH Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Returned Value
Considerations
Summary
The CHECKSWITCH procedure is called by a primary process to cause the duties of the primary
and backup processes to be interchanged.
The call to CHECKSWITCH contains an implicit call to the CHECKMONITOR procedure, so that
the caller becomes the backup and monitors the execution state of the new primary process. The
backup process must be in the monitor state (that is, in a call to CHECKMONITOR) for the
CHECKSWITCH call to be successful.
Syntax for C Programmers
This passive backup procedure is not supported in C programs. For a comparison of active backup
and passive backup, see the Guardian Programmer's Guide.
Syntax for TAL Programmers
status := CHECKSWITCH;
Returned Value
INT
A status word of this form:
Could not communicate with backup process, <8:15> = file-system error number.<0:7> = 1
<8:15> =<0:7> = 2
Primary process stopped.0
Primary process abnormally ended.1
Primary process processor failed.2
Primary process called CHECKSWITCH.3
NOTE: The normal return from a call to CHECKSWITCH is to the statement following a call to
the CHECKPOINT[MANY][X] procedure. The return corresponds to the latest call to
CHECKPOINT[MANY][X] by the primary process in which its stack was checkpointed.
The backup process executes the statement following the call to CHECKSWITCH only if the primary
process has not checkpointed its stack through a call to CHECKPOINT[MANY][X].
Considerations
• When to use CHECKSWITCH
Use CHECKSWITCH following the reload of a processor module. The purpose is to switch the
process pair's work back to the original primary processor module. CHECKSWITCH causes
164 Guardian Procedure Calls (C)