Re: Multiple ASTs for a Lock in a single process ?
From: John Santos (JOHN_at_egh.com)
Date: 03/12/04
- Next message: Martin Vorlaender: "Re: SSH, X11 forwarding and TCPIP V5.4"
- Previous message: Mike Naime: "Re: EVA disk storage"
- In reply to: JF Mezei: "Multiple ASTs for a Lock in a single process ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Mar 2004 02:29:32 -0500
On Mon, 8 Mar 2004, JF Mezei wrote:
> Ok, I have ALL-IN-1 do LIB$FDIND_IMAGE_SYMBOL against a shareable image of
> mine, then executes a routine inside that image. 99% of the time is spent
> inside my routine (for instance, when waiting for calls from the web server).
>
> ALL-IN-1 takes a lock called OA$_SHUTDOWN with a blocking AST. (see details of
> that lock at bottom of this post). Its only "Flag" is "SYSTEM".
>
> I have tested this yesterday. When the shutdown comes into effect, a user A1
> process doesn't exit until the user enters the next command. So it would seem
> that the blocking AST only sets a flag. There is a DCL procedure that also
> runs which will do a rather blunt STOP/ID on any process still running Allin1
> after 2 minutes (does a show dev/files/nosys and then searches for all
> processes with a channel to a specific allin1 file).
>
> Back to my problem: Is there a way for my routine to also be notified when the
> system manager notifies processes of the A1 shutdown ? Can one take the same
> lock twice in the same process ?
I *think* you can do this no problems. Each blocking AST will trigger
when the system manager attempts to grab the resource...
I was working on an application where I was worried about precisely
this issue a couple of years ago, then I realized that if you couldn't
do this, then a program that opened a file on more than one channel
couldn't lock records against itself, if this didn't work!
From the SDA output, it looks like each A1 process grabs a CR lock
on the resource, and then the shutdown procedure queues an incompatible
lock (probably EX?) that then triggers the blocking AST's in all the
A1 processes. This was the model I was using for controlling an
application, and it worked. I was writing a package of file-access
routines, and had no way to control how many different files an
application using them would open, etc. I was worried that the 2nd
"stream" would grab locks belonging to the 1st one, etc., but it all
worked right.
I would write some simple test programs to make sure I understood
all the issues, especially since the ASTs operate asynchronously,
so you have to be sure they only use local memory (on the stack)
or have some way of tracking what memory they own.
But it should all just work... Unless I've completely misunderstood
what's going on... It's late at night and I'm extremely tired and
caffeine-deprived!
> Or would the only way be to have my routine cancel the lock taken by All-IN-1
> and reissue it with the blocking AST pointing to my own code (which would then
> call the AST that had been specified by A1 after doing my own stuff) ?
I don't think this is necessary.
> My concern is that when the shutdown is done during iddle time, no commands
> would be sent by my routine to ALL-In-1, so ALL-In-1 woudln't exit by itself
> and thus be unceremoniously killed. What I want is to have DCL code look at
> the exit status and determine is it is just a temporary shutdown or a
> requested shutdwon (with temprary shutdown, the DCL could wait a couple
> minutes and then try to restart the app).
>
>
> Here is what SDA tells me about the lock :
>
> Process index: 0057 Name: A1 Extended PID: 20400557
> -------------------------------------------------------
> Lock data:
>
> Lock id: 0E00077C PID: 000A0057 Flags: SYSTEM
> Par. id: 00000000 SUBLCKs: 0
> LKB: 80C5A000 BLKAST: 000B260A
> PRIORTY: 0000
>
> Granted at CR 00000000-FFFFFFFF
>
> Resource: 54554853 5F24414F OA$_SHUT Status:
> Length 13 0000004E 574F445F _DOWN...
> User mode 00000000 00000000 ........
> System 00000000 00000000 ........
>
> Local copy
>
>
-- John Santos Evans Griffiths & Hart, Inc. 781-861-0670 ext 539
- Next message: Martin Vorlaender: "Re: SSH, X11 forwarding and TCPIP V5.4"
- Previous message: Mike Naime: "Re: EVA disk storage"
- In reply to: JF Mezei: "Multiple ASTs for a Lock in a single process ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|