IBM SC34-6814-04 Server User Manual


 
Because task-purging is effective only if performed between SUSPEND and
RESUME, Suspend-fail precedes Resume-fail. This means that, with the same
constraints on serialization as in the normal synchronization protocol, the task-purge
protocol can be logically reduced to:
The difference is that Set results and Get results are replaced by Clean up. It is
vital that only these two sequences can happen; this means that both programs
must be coded correctly. CICS ensures that both tasks are told either that
SUSPEND and RESUME processing worked, or that it failed.
The following shows the programming steps that conform to these rules:
Program for Task A Program for Task B
SET PARAMETERS;
RESUME B; GET PARAMETERS;
SUSPEND A; PROCESS REQUEST;
RESUME A;
if if
RESPONSE = OK RESPONSE ¬= OK
then then
GET RESULTS; CLEAN UP;
endif endif
If both the SUSPEND and RESUME return ‘OK’, the example follows the rules for
the normal synchronization; processing finishes at Get results. If neither SUSPEND
nor RESUME returns ‘OK’, the example follows the rules for the task-purge
protocol, and processing finishes at Clean up.
For further information about SUSPEND and RESUME processing, see the CICS
Problem Determination Guide.
Alternative approach to task purge
The sequence described above is one method for dealing with the problem of task
purge. Using this method, task B does not know, when it is processing the request,
whether or not task A has been purged; this means that B must take great care in
its use of resources owned by A (in case A has been purged). In some situations,
this restriction may cause difficulties.
A different approach is as follows; if task A is to be purged:
1. A communicates to B that it is no longer available, thus informing B not to use
any resources owned by A.
2. A performs its own clean-up processing (including issuing the RESUME call for
the purged SUSPEND, as required by the dispatcher protocols), and abends.
3. B performs its own clean-up processing.
Task A: Set parameters; Resume task B; Suspend-fail
Task B: Get parameters; Process request; Resume-fail; Clean up both
Set parameters; Get parameters; Process request; Clean up
Chapter 3. The user exit programming interface (XPI) 333