# US 2026/0186864 A1 · Method, system, and program for deadlock avoidance

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0186864 A1
- Document ID: US20260186864A1
- Status: Published application
- Kind: A1
- Application number: 18/862,769
- Filed: 2024-08-20
- Published: 2026-07-02
- Earliest claimed: 2023-08-21
- Assignees: Phoenix Software International, Inc.
- Applicants: Phoenix Software International, Inc.
- Inventors: Thomas Alan Harper
- Web page: https://patentgrep.com/patent/US20260186864A1

## CPC

- G06F 9/524: {Deadlock detection or avoidance}
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 9/466: {Transaction processing}
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 11/1438: {Restarting or rejuvenating}
- G06F 11/1471: involving logging of persistent data for recovery
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to systems, methods, processes, techniques, and computer program products to prevent deadlocks in a mainframe computing system through certain protocols in a lock request, contention exit, and notify exit routines.

## Claims

### Claim 1

A method for preventing deadlocks in a mainframe computing system comprising:
invoking a lock request (LR) routine, by a computer processor, in response to a LR from a requesting transaction, wherein a LR includes a lock has value (LHV), and lock user data (LUD), wherein the LR routine includes determining whether contention exists between the requesting transaction and one or more other transactions;
invoking a contention exit (CE) routine, by the computer processor, in response to a determination that contention exists; wherein the CE routine includes:
determining, by the computer processor, if the requesting transaction holds other locks;
in response to an affirmative determination that the requesting transaction holds other locks, determining, by the computer processor, if the LR is a retry request by checking if a retry indicator is set;
determining, by the computer processor, whether other lock contenders (LC) for the requested lock hold other locks; and
in response to an affirmative determination that the other LCs hold other locks, invoking, by the computer processor, a notify exit (NE) routine on each of the other LCs that hold other locks, wherein the NE routine includes:
placing a most current LHV for each of the other LCs that hold other locks in a notify exit user data (NEUD) if a transaction for each of the other LCs has a LR that has a same LHV of a LHV of the LR from the requesting transaction, and exiting the NE routine;
upon exiting the NE routine, invoking, by the computer processor, the CE routine a second time, wherein the CE routine further includes:
placing, by the computer processor, all LHVs from the NEUD in the LUD of the requesting transaction;
determining, by the computer processor, if there are more LHVs than can fit in the LUD of the requesting transaction; and
in response to an affirmative determination that there are more LHVs than can fit in the LUD of the requesting transaction, setting an ambiguity indicator in the LUD, denying the LR, and exiting the CE routine; and
upon exiting the CE routine for a second time, completing the LR routine, wherein the LR routine further includes:
determining, by the computer processor, whether the ambiguity indicator in the LUD is set;
in response to a determination that the ambiguity indicator in the LUD is not set, determining, by the computer processor, a match between a LHV the requesting transaction owns compared to the LHVs in the LUD of the requesting transaction;
in response to a determination of a match, turning on the ambiguity indicator in the LUD, rolling back and retrying the transaction from a last syncpoint; and
in response to a determination of no match, setting the retry indicator and reissuing the LR.

### Claim 2 (depends on 1)

The method of claim 1, wherein the LR further includes a lock resource name (LRN), and a lock status (LS).

### Claim 3 (depends on 1)

The method of claim 1, wherein the CE routine further includes: in response to a determination that the requesting transaction does not hold other locks, keeping the LR pending and exiting the CE routine.

### Claim 4 (depends on 1)

The method of claim 1, wherein the CE routine further includes: in response to a determination the LR is not a retry request, keeping the LR pending, and exiting the CE routine.

### Claim 5 (depends on 1)

The method of claim 1, wherein reissuing the LR restarts the LR routine.

### Claim 6 (depends on 1)

The method of claim 1, wherein:
the LR further includes a lock resource name (LRN), a lock status (LS);
the CE routine further includes: in response to a determination that the requesting transaction does not hold other locks, keeping the LR pending and exiting the CE routine;
the CE routine further includes: in response to a determination the LR is not a retry request, keeping the LR pending and exiting the CE routine; and
reissuing the LR restarts the LR routine.

### Claim 7

A computer program product for preventing deadlocks in a mainframe computing system, the computer program product stored in a computer-readable storage medium, comprising program code that, when executed by the mainframe computing system, causes the computing system to perform actions comprising:
invoking a lock request (LR) routine, by a computer processor, in response to a LR from a requesting transaction, wherein a LR includes a lock has value (LHV), and lock user data (LUD), wherein the LR routine includes determining whether contention exists between the requesting transaction and one or more other transactions;
invoking a contention exit (CE) routine, by the computer processor, in response to a determination that contention exists; wherein the CE routine includes:
determining, by the computer processor, if the requesting transaction holds other locks;
in response to an affirmative determination that the requesting transaction holds other locks, determining, by the computer processor, if the LR is a retry request by checking if a retry indicator is set;
determining, by the computer processor, whether other lock contenders (LC) for the requested lock hold other locks; and
in response to an affirmative determination that the other LCs hold other locks, invoking, by the computer processor, a notify exit (NE) routine on each of the other LCs that hold other locks, wherein the NE routine includes:
placing a most current LHV for each of the other LCs that hold other locks in a notify exit user data (NEUD) if a transaction for each of the other LCs has a LR that has a same LHV of a LHV of the LR from the requesting transaction, and exiting the NE routine;
upon exiting the NE routine, invoking, by the computer processor, the CE routine a second time, wherein the CE routine further includes:
placing, by the computer processor, all LHVs from the NEUD in the LUD of the requesting transaction;
determining, by the computer processor, if there are more LHVs than can fit in the LUD of the requesting transaction; and
in response to an affirmative determination that there are more LHVs than can fit in the LUD of the requesting transaction, setting an ambiguity indicator in the LUD, denying the LR, and exiting the CE routine; and
upon exiting the CE routine for a second time, completing the LR routine, wherein the LR routine further includes:
determining, by the computer processor, whether the ambiguity indicator in the LUD is set;
in response to a determination that the ambiguity indicator in the LUD is not set, determining, by the computer processor, a match between a LHV the requesting transaction owns compared to the LHVs in the LUD of the requesting transaction;
in response to a determination of a match, turning on the ambiguity indicator
in the LUD, rolling back and retrying the transaction from a last syncpoint; and
in response to a determination of no match, setting the retry indicator and reissuing the LR.

### Claim 8 (depends on 7)

The computer program product of claim 7, wherein the LR further includes a lock resource name (LRN), and a lock status (LS).

### Claim 9 (depends on 7)

The computer program product of claim 7, wherein the CE routine further includes: in response to a determination that the requesting transaction does not hold other locks, keeping the LR pending and exiting the CE routine.

### Claim 10 (depends on 7)

The computer program product of claim 7, wherein the CE routine further includes: in response to a determination the LR is not a retry request, keeping the LR pending, and exiting the CE routine.

### Claim 11 (depends on 7)

The computer program product of claim 7, wherein reissuing the LR restarts the LR routine.

### Claim 12 (depends on 7)

The computer program product of claim 7, wherein:
the LR further includes a lock resource name (LRN), a lock status (LS);
the CE routine further includes: in response to a determination that the requesting transaction does not hold other locks, keeping the LR pending and exiting the CE routine;
the CE routine further includes: in response to a determination the LR is not a retry request, keeping the LR pending and exiting the CE routine; and
reissuing the LR restarts the LR routine.

### Claim 13

A deadlock prevention system comprising:
one or more processors;
one or more computer-readable storage media operably coupled to at least one of the processors; and
program instructions stored on the one or more computer-readable storage media for execution by at least one of the processors to cause the deadlock prevention system to perform the actions of:
invoking a lock request (LR) routine, by at least one of the processors, in response to a LR from a requesting transaction, wherein a LR includes a lock has value (LHV), and lock user data (LUD), wherein the LR routine includes determining whether contention exists between the requesting transaction and one or more other transactions;
invoking a contention exit (CE) routine, by at least one of the processors, in response to a determination that contention exists; wherein the CE routine includes:
determining, by at least one of the processors, if the requesting transaction holds other locks;
in response to an affirmative determination that the requesting transaction holds other locks, determining, by at least one of the processors, if the LR is a retry request by checking if a retry indicator is set;
determining, by at least one of the processors, whether other lock contenders (LC) for the requested lock hold other locks; and
in response to an affirmative determination that the other LCs hold other locks, invoking, by at least one of the processors, a notify exit (NE) routine on each of the other LCs that hold other locks, wherein the NE routine includes:
placing a most current LHV for each of the other LCs that hold other locks in a notify exit user data (NEUD) if a transaction for each of the other LCs has a LR that has a same LHV of a LHV of the LR from the requesting transaction, and exiting the NE routine;
upon exiting the NE routine, invoking, by at least one of the processors, the CE routine a second time, wherein the CE routine further includes:
placing, by at least one of the processors, all LHVs from the NEUD in the LUD of the requesting transaction;
determining, by at least one of the processors, if there are more LHVs than can fit in the LUD of the requesting transaction; and
in response to an affirmative determination that there are more LHVs than can fit in the LUD of the requesting transaction, setting an ambiguity indicator in the LUD, denying the LR, and exiting the CE routine; and
upon exiting the CE routine for a second time, completing the LR routine, wherein the LR routine further includes:
determining, by at least one of the processors, whether the ambiguity indicator in the LUD is set;
in response to a determination that the ambiguity indicator in the LUD is not set, determining, by at least one of the processors, a match between a LHV the requesting transaction owns compared to the LHVs in the LUD of the requesting transaction;
in response to a determination of a match, turning on the ambiguity indicator in the LUD, rolling back and retrying the transaction from a last syncpoint; and
in response to a determination of no match, setting the retry indicator and reissuing the LR.

### Claim 14 (depends on 13)

The system of claim 13, wherein the LR further includes a lock resource name (LRN), and a lock status (LS).

### Claim 15 (depends on 13)

The system of claim 13, wherein the CE routine further includes: in response to a determination that the requesting transaction does not hold other locks, keeping the LR pending and exiting the CE routine.

### Claim 16 (depends on 13)

The system of claim 13, wherein the CE routine further includes: in response to a determination the LR is not a retry request, keeping the LR pending, and exiting the CE routine.

### Claim 17 (depends on 13)

The system of claim 13, wherein reissuing the LR restarts the LR routine.

### Claim 18 (depends on 13)

The system of claim 13, wherein:
the LR further includes a lock resource name (LRN), a lock status (LS);
the CE routine further includes: in response to a determination that the requesting transaction does not hold other locks, keeping the LR pending and exiting the CE routine;
the CE routine further includes: in response to a determination the LR is not a retry request, keeping the LR pending and exiting the CE routine; and
reissuing the LR restarts the LR routine.
