LATCHSET1 DC CL48'EXAMPLE.ONE_LATCH_SET_1'
LATCHSET2 DC CL48'EXAMPLE.ONE_LATCH_SET_2'
LATCHSET3 DC CL48'EXAMPLE.ONE_LATCH_SET_3'
MVC REQ_IDH,PSAAOLD-PSA /* use home ASCB address and */
MVC REQ_IDL,PSATOLD-PSA /* TCB address as requestor ID */
The first word of the requestor_ID contains the ASCB address of the home address space and the second word is the address of the TCB. For each address space, that has tasks using the latch sets, an end-of-memory resource manager is set up. If you are also using SRBs that would obtain and release latches you could use a similar scheme for the requestor IDs. For instance, the first word could be the ASCB and the second word could be the address of some control block in common (so that the address would be unique and different from the TCB address used by the non-SRB requestors). This is especially useful when the unique portion of the requestor_ID may not be readily determinable by the latch purge requestor.
USING RMPL,R4
MVC REQ_IDH,RMPLASCB /* use the terminating ASCB addr */
MVC REQ_IDL,ZEROS /* rest of req_id should be zero */
REQID_MK DC 4X'FF' /* match terminating ASCB */
XL4'0' /* mask off TCB address - */
* /* purge latches for */
* /* for all tasks */
LSNME DC CL22'EXAMPLE.ONE_LATCH_SET_' /* common part */
DC XL26'0' /* unique part */
LSNME_MK DC 22X'FF' /* common part */
DC XL26'0' /* unique part */
CALL ISGLPBA,(LS_TOKEN,REQ_ID,REQID_MK, X
LSNME,LSNME_MK,RETCD),MF=(E,PBYA_DPL)
LS_TOKEN DC XL8'0' /* use latch set name and */
* /* latch set name mask */
latch_set_name 'EXAMPLE.ONE_LATCH_SET_1_..................'
CECDDDC7DDC6DCECC6ECE6F4444444444444444444444444
57147355655D31338D253D10000000000000000000000000
latch_set_name_mask FFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000
_________________________________________________
result: 'EXAMPLE.ONE_LATCH_SET_..........................'
CECDDDC7DDC6DCECC6ECE600000000000000000000000000
57147355655D31338D253D00000000000000000000000000
When the result is compared to the latch_set_name operand, LSNME there is a match and the service will try to purge latches in this latch set.
ASCB TCB
00FA7880008FD8E0
requestor_ID: 00FA7880008FD8E0
requestor_ID_mask: FFFFFFFF00000000
________________
result: 00FA788000000000
When the result is compared, to the requestor ID operand, there is a match and the latch request will be purged.