Timing contention

You can set a timer with ECB and also use the ECB option on ISGENQ, ENQ, and RESERVE services to measure the amount of time you want to wait for the resource to become available. First, you wait on both ECBs. When one ECB is posted, check if the posted ECB was for the timer or for the GRS service. If the timer expired first, use DEQ or ISGENQ REQUEST=RELEASE to release the GRS resource. For an ENQ resource, before you use DEQ to release the resource, you might consider using the ISGECA service to determine the possible blocker or blockers of the resource. The amount of time that you wan to wait depends on the tolerance of your application. The time cannot be determined in some cases. See z/OS MVS Programming: Authorized Assembler Services Reference EDT-IXG and z/OS MVS Programming: Authorized Assembler Services Reference LLA-SDU for more information about the ECB option on ISGENQ, ENQ and RESERVE services.