>However, I don't want to obtain CMS lock while CMSSMF or CMSEQDQ is held
(ABEND073).

And how are "you" getting control? You should have understandings of your
caller's environments. Perhaps I'm wrong, but I cannot think of any place
in the system where non-system code would get called holding the CMSSMF
lock. And only one (very specific, not general) for the CMSEQDQ lock

> This is correct. There are no hierarchy considerations related to
obtaining the CPU lock

>>True with spin lock. But, not true with suspend lock per document.
>>And always obtainable for disablement of interrupts >and I/O.

I have no idea what the sentence beginning "But" is intended to say. There
are NO hierarchy considerations related to obtaining the CPU lock. Period.
You can obtain the CPU lock at any time.

>What test do I need before (if any):
>SETLOCK OBTAIN,TYPE=LOCAL
You might consider SETLOCK TEST,TYPE=ALOCAL ("any local") and then test the
result for whether the caller held the LOCAL lock or a CML lock, as you
cannot obtain the LOCAL lock if you hold the CML lock of another address
space.

>What test do I need before (if any):
>SETLOCK OBTAIN,TYPE=CMS
It depends what you are trying to determine. If you are trying to determine
"am I allowed to obtain the CMS lock" then you should check if you are
disabled (for instance via STNSM preserving the PSW mask, and checking the
result). If you are disabled, then you cannot. You could determine "do I
have a local lock". If you do not yet, then you cannot obtain the CMS lock.
And you can issue SETLOCK TEST,TYPE=CMS to see if you already have the CMS
lock (or any of its analogs). This will not distinguish between the
different CMS locks, but as I said, none of them are programming
interfaces. Note that if you issue SETLOCK OBTAIN for a lock that you
already have (aside from CPU), the system will just give you a return code
that says "you already hold it". You should react to that return code by
(usually) not freeing the lock at the end of your processing when the test
means that it was your caller who had obtained it.


>What test do I need before (if any):
>SETLOCK RELEASE,TYPE=CMS
>What test do I need before (if any):
>SETLOCK RELEASE,TYPE=LOCAL
You do not need any tests before issuing a SETLOCK RELEASE of a suspend
lock, though it rarely hurts to test if *you* were the one who obtained the
lock so that you are not releasing the lock that someone else might have
obtained and might depend upon being held across their call to you.

But the real question is: what are you serializing? Can you use ENQ? can
you use PLO? Inappropriate use of the CMS lock can adversely affect the
running of the system.

Peter Relson
z/OS Core Technology Design

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to