Regarding CMS lock:
CMS is a global suspend lock, you do not need an address space bind to obtain 
it, but if you are not careful you could adversely impact the performance of 
the system (blocking the system's access to it while you hold it). There is 
rarely call for something outside z/OS itself to obtain this lock.

Regarding CPU lock:
Remember that while holding the CPU lock all storage that you touch (including 
the storage for your program) must be page-fixed or disabled-reference.
And while holding the CPU lock (or while in any case of being disabled for 
external/IO interrupts) any suspend lock obtain (LOCAL, CML, CMS) can only be 
conditional. If the lock is not immediately available, you get control back 
with an appropriate return code.

Regarding SSAR: If this is a reusable ASID, you would have to use SSAIR.

Regarding CML: the specific requirement to avoid 073-x'10' upon SETLOCK OBTAIN 
for a CML is to have either PASN or SASN match the ASID associated with the 
provided ASCB.
The normal way that that happens is via a space-switch PC (setting your new 
PASN) and then obtaining the CML of the now-current PASN address space.
It is not, in general, safe to SSAR (or SSAIR) to any ASN you might have a mind 
to want to access. In many cases, the target of cross-memory access must be 
non-swappable.

All of this leads to the thought that you might want to explain what 
specifically you feel you are trying to accomplish that necessitates the lock 
operations (and your questions) so that others can help to guide you. There is 
a very real possibility of harm if you get it wrong. Getting it right is part 
of the responsibility that goes with running in supervisor state (and in this 
case key 0).

Peter Relson
z/OS Core Technology Design

Reply via email to