gtpa2m1qApplication Programming

Deadlock Detection

A deadlock detection routine is provided to assist with deadlock detection. This routine is a time initiated routine and is activated during restart or by the CRETC macro.

Deadlock detection processing is applied on loosely coupled systems and base-only systems. It consists of taking a snapshot of all of the record hold tables (RHTs) in the complex, merging them into a table, and then running the table through the deadlock detection algorithm.

To have a true event, a cutoff time (the earliest of the time stamps associated with each CPU snapshot of the RHT) determines whether an individual entry of an RHT of a CPU will be merged into the table. If a record is held within the cutoff time, the related RHT entry is merged into the table. Otherwise, the entry is discarded.

When the deadlock detection program is activated, the CPU that has the lowest ordinal number will be the master CPU. The master CPU merges all of the RHT snapshots that were sent by other CPUs and performs the deadlock detection routine.

If a deadlock is detected, a deadlock user exit (CLUD) is activated on the CPU where the deadlocked ECB is located. The deadlock detection routine takes an action as follows:

You can also use the ZECBL command with the E parameter to remove all the IOBs associated with the deadlocked ECB and force the ECB to exit with dump D9.

SYSTC switch SBDLOCK is defined for deadlock detection processing. You can turn it off using the ZSYSG ALTER command with the NODLOCK parameter.