At 18:43 -0500 on 05/21/2007, Paul Gilmartin wrote about Re: Why is
there JOB scope for DSN ENQ's anyway?:
On Mon, 21 May 2007 16:01:57 -0700, Edward Jaffe wrote:
I've never heard of an ENQ with job scope. A quick look at the ISGENQ
service shows the following scope values:
OK. We were being careless, and I may be at fault for starting it.
The issue is why ENQs are issued at the beginning of the job and
held until the last step that uses the data set name, rather
than being dequeued after each step and re-enqueued at the next
step, and for only the data set names used in that step.
There is a simple reason. The ENQs are done before the job is started
so that all of the datasets are available to the steps. If you
release and reacquire the ENQs, there is a possibility that you will
not be able to reacquire them (due to some other job grabbing them
between your DEQ and ENQ) or even worse, ending up in a deadly
embrace (where two jobs each want the same ENQs but can not get
them). The way it works now, you wait until everything is available
and then run, doing DEQs for those datasets that are no longer needed.
The question of holding a Exclusive ENQ when you only need a Shared
ENQ (ie: Exclusive in Step1 and continuing to hold Exclusive when
only needing Shared in subsequent steps) is due to a poor ENQ design
that has no provision for altering an Exclusive to a Shared (while
having the useless Shared to Exclusive capability that is almost
impossible to be able to use due to the probability that some other
task shares your Shared ENQ lock). The amount of coding work needed
to fix this design flaw is under one man day (just flip the E/S flag
in the ENQ queue record from E to S and then drive the routine that
handles a DEQ of an Exclusive ENQ that is followed on its queue by a
waiting Shared ENQ [IOW: Take entries 2+ out of hold and assign them
as Shared owners of the ENQ until you run off the end of the list or
encounter another Exclusive ENQ request]). IBM has repeated refused
to devote the minimal resources needed to fix this problem.
Note: I acknowledge that there also needs to be updates to the ENQ
and ISGENQ macros to request this option and a new flag bit in their
Parm fields. That and what happens if you make the request on a
system that is missing the support is the bigger problem than making
the few lines of code change to support the capability.
"Duration" would have been a better word than "scope", which is
already used in the other sense.
-- gil
----------------------------------------------------------------------
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