T.R | Title | User | Personal Name | Date | Lines |
---|
618.1 | | RIKKA::PALO | bad sneakers | Thu Dec 03 1987 15:41 | 15 |
|
If this is a multiprocessing application, then it's pretty much left to the
interprocess (intra-application) event handling to notify the process that owns
the lock to release it.
It's conceivable that the DLM could be used for the event mechanism, with
assorted things like lockvalue blocks and blocking ASTs and such (if need be).
If this is not the case, then it sounds like there is no co�peration between
any of the processes (cluster-wide) anyway; so why bother - it's erroneous.
maybe you should give a small representative model of what you need to
accomplish?
\rikki
|
618.2 | Here's why we want it ! | HAMPS::JONES_S | DEC OLTP is the one for me ! | Fri Dec 04 1987 04:09 | 23 |
| The problem is we're taking a CICS based application generation
facility, and shifting it to VAX. The resource locking strategy
they use (their own) is holding resource locks across screen I/O.
We do not wish to use 1 process per person for resouce reasons,
and thus we wish to have serially re-useable server processes which
asynch. terminal handlers can pass work to. This means we cannot
allocate 1 server to a user - has horrible effects on throughput
on a TP system (which is what this will be).
Hence we need to take out a lock in a server, and hold it while
releasing the server process for another terminal user. We can't
then assume we'll re-appear within the same server to get the next
item of work done.
I guess we can have a single "lock manager" process on each machine
which we communicate to via a global section to get locks, however
I think this could prove to be a bottleneck on a heavily used system,
hence the question about using VMS Lock Manager.
Any and all ideas gratefully accepted
Steve
|
618.3 | quote from $ENQ system service | PASTIS::MONAHAN | I am not a free number, I am a telephone box | Fri Dec 04 1987 07:56 | 17 |
| Since this is "hackers" check out :-
LCK$M_CVTSYS This flag is reserved to DIGITAL. When this
flag is set, the lock is converted from a
process-owned lock to a system-owned lock.
The calling process must be running in executive
or kernel mode to set this flag.
(SYS-143)
When I looked at the code this seemed to be doing what you want. I
would suggest that a user-written system service or a protected
shareable image might be the right way to use it.
Or maybe I have misunderstood what you want?
Dave
|
618.4 | No, not really useful | RIKKA::PALO | bad sneakers | Fri Dec 04 1987 08:22 | 21 |
| RE: .3
This really doesn't do much unless the two processes are in different
UIC groups, in which case the lock needed to be system anyway. The problem
is $DEQ (or $ENQ (convert)) on behalf of another's process which is not
solved by the DLM.
RE: .2
It sounds to me that perhaps ACMS should be evaluated to see whether there
is anything it helps... (I'll show my ignorance of only thinking ACMS is
for TP applications)
Alternately, if this application is being completely rewritten, maybe you
should look into PPL$ (for the multi-processing aspects of the application)
and utilize it's wealth of semaphores, events and barriers; for the
cluster-wide aspects use some co�rdinated DLM scheme.
regards,
\rikki
|
618.5 | There hafta be a dozen different ways to do this | SQM::HALLYB | Khan or bust! | Mon Dec 07 1987 16:52 | 34 |
| I'm still not sure I completely understand the problem. Say we
have Processes A (PID 2100000A), B (PID 2100000B), and C (PID 2100000C).
Travel agent (TA) hits magic key combination that says "show me
the Chicago>>Denver flights for March 4th". This combination of
keystrokes gets shipped off to Process C, because A and B are "busy".
Process C observes input on an I/O channel and reads the request.
C obtains a CR lock (on, say, "ORD-DEN-88.03.04") and then goes out to a
file and gets the flight schedules and ships them off to the sender.
Then C converts the lock to NL mode, copying a sequence number from
the lock value block. (Also specifying CVTSYS).
The TA reads the list, gets a cup of coffee, thinks, and finally
fills in a request for the 9:33 United flight. TA hits ENTER and
the request is stuffed down the pipe. This time Process A is free,
so A gets the filled-in request.
At this point A does another $ENQ(PW) on "ORD-DEN-88.03.04" and reads
the value block. If the sequence number in the value block is the
same, then by design no changes have been made to that resource.
So (normal case) the reservation is made, the sequence number is
bumped and the lock is converted to system, NL mode. It makes no
difference that C is used for part of the reservation and A another.
If somebody else made a change to the resource while TA was looking
at it on the screen, then the value block sequence number will be
different and the application knows it has to go out and reread
the "locked" block before trying to complete the reservation.
Now what is it about the application methodology that is so different
from this model? Can you respond in specific terms?
John
|
618.6 | | CASEE::VANDENHEUVEL | Make my Day | Wed Dec 09 1987 09:51 | 38 |
| The mechanisme John shows is one way. It has the possible
disadvantage that the user goes through a certain effort
to find out that is was all in vain when the time comes
to update a record.
An alternative could be:
ENQ a lock using the recourcename. If it did not exist; fine. The
resource is all yours. Put the identification of the user you are
currenty serving in the value block. Convert to NL.
If the lock did exist, check the value block, if it mentions the
same user you intended to server then proceed. If an other user
identification is found then you give an error message to the
current requestor. In either case convert to NL on receipt.
Yes the lock will become owned by severs tempting to get it. So what.
Possible refinement:
- Investigate the possibillity to use multiple lock levels to
distiguish between first ENQ and subsequent ENQ for re-entries into
severs.
- If you want to build in waiting on a lock; you will probably
need a second lock; based on the terminal id:
1 ENQ to take out a lock on a resource. Convert to NL
2 ENQW to take out a lock on the user-id. Keep it.
If step 1 fails, ENQ with WAIT on user id and retry the
resource lock when you get the user-id lock.
3 DEQ to Release resource lock, clearing the value block.
4 DEQ to Release user-id lock.
Somehing like that anyway.
Hey Rikki, It is precisely ACMS that has this problem!
Hope this helps,
Hein.
|
618.7 | | CLT::GILBERT | Builder | Sat Dec 12 1987 13:12 | 7 |
| Use RMS. Create an indexed file with the resource-id as the key,
a field to indicate whether the resource is locked, and (if necessary)
a list of waiting processes (who should be notified to "try again"
when the resource becomes unlocked).
BTW, it sounds like you're implicitly storing the fact that resources
are locked (how else would you know they need to be unlocked eventually?).
|