Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Parallel lines never meet, unless you bend one or both of them.


computers / comp.os.vms / Re: Returning data from Cobol AST routine.

SubjectAuthor
* Returning data from Cobol AST routine.Jan-Erik Söderholm
+* Re: Returning data from Cobol AST routine.Arne Vajhøj
|`* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
| `* Re: Returning data from Cobol AST routine.Arne Vajhøj
|  +* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |`* Re: Returning data from Cobol AST routine.abrsvc
|  | `* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |  `* Re: Returning data from Cobol AST routine.Dave Froble
|  |   +* Re: Returning data from Cobol AST routine.abrsvc
|  |   |`* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |   | `* Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |   |  `* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |   |   +* Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |   |   |`* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |   |   | `* Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |   |   |  `* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |   |   |   +- Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |   |   |   `- Re: Returning data from Cobol AST routine.Bob Gezelter
|  |   |   `- Re: Returning data from Cobol AST routine.Dave Froble
|  |   `* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
|  |    `* Re: Returning data from Cobol AST routine.Dave Froble
|  |     +* Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |     |`* Re: Returning data from Cobol AST routine.Dave Froble
|  |     | `* Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |     |  `* Re: Returning data from Cobol AST routine.Lawrence D’Oliveiro
|  |     |   `- Re: Returning data from Cobol AST routine.Arne Vajhøj
|  |     +* Re: Returning data from Cobol AST routine.Bob Gezelter
|  |     |`- Re: Returning data from Cobol AST routine.Dave Froble
|  |     `- Re: Returning data from Cobol AST routine.Stephen Hoffman
|  `* Re: Returning data from Cobol AST routine.Arne Vajhøj
|   `- Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
+- Re: Returning data from Cobol AST routine.Dave Froble
+- Re: Returning data from Cobol AST routine.Bob Gezelter
+* Re: Returning data from Cobol AST routine.Stephen Hoffman
|`* Re: Returning data from Cobol AST routine.Jan-Erik Söderholm
| `- Re: Returning data from Cobol AST routine.Stephen Hoffman
+- Re: Returning data from Cobol AST routine.Hein RMS van den Heuvel
`* Re: Returning data from Cobol AST routine.Andrew Commons
 `* Re: Returning data from Cobol AST routine.Stephen Hoffman
  `* Re: Returning data from Cobol AST routine.Andrew Commons
   +* Re: Returning data from Cobol AST routine.Stephen Hoffman
   |`- Re: Returning data from Cobol AST routine.Dave Froble
   `- Re: Returning data from Cobol AST routine.Lee Gleason

Pages:12
Re: Returning data from Cobol AST routine.

<sie2al$87k$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17073&group=comp.os.vms#17073

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Tue, 21 Sep 2021 21:53:26 -0400
Organization: Aioe.org NNTP Server
Message-ID: <sie2al$87k$1@gioia.aioe.org>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<sidhu6$fha$5@dont-email.me> <sie21v$v6s$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="8436"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Arne Vajhøj - Wed, 22 Sep 2021 01:53 UTC

On 9/21/2021 9:46 PM, Dave Froble wrote:
> On 9/21/2021 5:13 PM, Jan-Erik Söderholm wrote:
>> But my guess is that, if you queue QIOs from multiple sources, the AST
>> routine must have some way to tell which source it was that trigged
>> the AST. Say you make (made up example, not part of our current target)
>> 10 QIO calls having the address of the same AST routine in the calls,
>> each QIO reading from its own TNA device, you need to know in the AST
>> routine which TNA device (like 10 different production machines) it
>> was that sent something.
>
> That sounds like a real headache.  Perhaps event flags would help.  I
> tend to avoid event flags.
>
>> I have probably not read enough aboit AST and QUI calls yet...
>
> ASTs can be fun.  I try to use them to set flags or cancel I/O.
> Cancelling an I/O causes a completion of an async read.  I feel that if
> I try to get "tricky", I'll outsmart myself,

That is why I suggested a message queue instead of mailboxes,
$QIO(W) and AST's.

Way less options for experiencing "unexpected features".

Arne

Re: Returning data from Cobol AST routine.

<sie2q2$20g$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17074&group=comp.os.vms#17074

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Tue, 21 Sep 2021 21:59:10 -0400
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <sie2q2$20g$1@dont-email.me>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<sidhu6$fha$5@dont-email.me> <sie21v$v6s$1@dont-email.me>
<sie2al$87k$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 22 Sep 2021 02:01:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="357520f68e0c5ae9cbcf58c098d199b9";
logging-data="2064"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/r4eT2zLJDPKHIWjBgGynH67NvgMXcH9Y="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:j6NW6/wiOITGa8sH3Epj0YEZpfI=
In-Reply-To: <sie2al$87k$1@gioia.aioe.org>
 by: Dave Froble - Wed, 22 Sep 2021 01:59 UTC

On 9/21/2021 9:53 PM, Arne Vajhøj wrote:
> On 9/21/2021 9:46 PM, Dave Froble wrote:
>> On 9/21/2021 5:13 PM, Jan-Erik Söderholm wrote:
>>> But my guess is that, if you queue QIOs from multiple sources, the AST
>>> routine must have some way to tell which source it was that trigged
>>> the AST. Say you make (made up example, not part of our current target)
>>> 10 QIO calls having the address of the same AST routine in the calls,
>>> each QIO reading from its own TNA device, you need to know in the AST
>>> routine which TNA device (like 10 different production machines) it
>>> was that sent something.
>>
>> That sounds like a real headache. Perhaps event flags would help. I
>> tend to avoid event flags.
>>
>>> I have probably not read enough aboit AST and QUI calls yet...
>>
>> ASTs can be fun. I try to use them to set flags or cancel I/O.
>> Cancelling an I/O causes a completion of an async read. I feel that
>> if I try to get "tricky", I'll outsmart myself,
>
> That is why I suggested a message queue instead of mailboxes,
> $QIO(W) and AST's.

You'd still have to check the message periodically. Testing a flag, and
already having the message in a buffer, should be more efficient.

> Way less options for experiencing "unexpected features".
>
> Arne

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: Returning data from Cobol AST routine.

<siemmp$qmo$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17078&group=comp.os.vms#17078

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jan-erik...@telia.com (Jan-Erik Söderholm)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 22 Sep 2021 09:41:12 +0200
Organization: A noiseless patient Spider
Lines: 117
Message-ID: <siemmp$qmo$1@dont-email.me>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<8ba4661e-181c-48dc-9b35-a441c7e58eefn@googlegroups.com>
<sidida$fha$6@dont-email.me> <sidlue$554$1@gioia.aioe.org>
<sidntn$fha$7@dont-email.me> <sidq1e$1is3$1@gioia.aioe.org>
<sidth7$fha$8@dont-email.me> <sie1cp$1uvq$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 22 Sep 2021 07:41:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3ae8cbea29729bf50f342325c405b072";
logging-data="27352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HhqIyItXg+0VAdJe2g6O0"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:TOoUfLjIrJq5aw/46gkvC0KM6Fk=
In-Reply-To: <sie1cp$1uvq$1@gioia.aioe.org>
Content-Language: sv
 by: Jan-Erik Söderholm - Wed, 22 Sep 2021 07:41 UTC

Den 2021-09-22 kl. 03:37, skrev Arne Vajhøj:
> On 9/21/2021 8:31 PM, Jan-Erik Söderholm wrote:
>> Den 2021-09-22 kl. 01:31, skrev Arne Vajhøj:
>>> On 9/21/2021 6:55 PM, Jan-Erik Söderholm wrote:
>>>> This ACCVIO's on the display statement. The weird thing is that
>>>> the virtual address in the ACCVIO message is ...00042D, and that
>>>> is the hex for the value I used, in decimal 1234.
>>>>
>>>> I must be missing something, it looks like the display statement tries
>>>> to use the value in reqidt as an address instead of the actual value...
>>>
>>> I know next to nothing about COBOL, but if COBOL use call by ref as
>>> default like FORTRAN, so that the AST routine expects an address,
>>> then the error makes sense.
>>
>> Right. When calling *from* Cobol you can specify "by ref", "by val"
>> and so on. I have looked but I cannot find anything similar when a
>> Cobol routine is *called*. But yes, it very much looks like that a
>> called Cobol routine expects a "by ref" (pointer) parameter.
>>
>> But the SETIMR docs says that this parameter is sent by value.
>>
>>> And the solution could be to call with
>>> address of reqidt in main code (I don't know how to do that i COBOL
>>> but it must be possible).
>>>
>>
>> Good point... And that solved this issue!
>>
>>
>> 01  reqidt              pic 9(9)    comp.
>> ...
>>      move 1234 to reqidt
>>      call "sys$setimr"
>>          using omitted
>>                by reference delta-time
>>                by value ast-proc-addr
>>                by reference reqidt    <<==
>>                omitted
>>          giving return-value
>>      end-call
>>
>> Replaced "by value reqidt" with "by reference reqidt".
>> That will pass the address (pointer) to reqidt.
>> Silly not thinking about that...
>>
>> The AST routine just uses the paramater as-is as before
>> an now prints "reqidt: 1234" as expected.
>
> I would probably have preferred to keep the formal
> argument as by val and stuffed the address into an integer
> and passed that. Slightly more complicated but I just
> don't like faking the passing mechanism of a system
> service.
>
> Arne
>

Not that much more complicated, one additional pointer definition:

01 reqidt_addr pointer value reference reqidt.
01 reqidt pic 9(9) comp.
....
move 1234 to reqidt

call "sys$setimr"
using omitted
by reference delta-time
by value ast-proc-addr
by value reqidt_addr
omitted
giving return-value
end-call

This also works. A matter of taste, I guess. :-)

Now, a bigger issue is that I found this in the Rdb docs:

------------------------------------------------------------
15.3 Avoiding Asynchronous System Traps

You should not use asynchronous system trap (AST) service routines in
an application that accesses Oracle Rdb databases. If you do, Oracle
Rdb cannot guarantee the behavior of the application.

Because several Oracle Rdb components use AST service routines and
because an AST cannot be delivered while an AST service routine is
currently executing at the same mode or more privileged mode, using
an AST service routine in an application can prevent the delivery of
an AST in one of the components of Oracle Rdb.
------------------------------------------------------------

I posted a question on the Rdb mailing list regarding ASTs, and got
this from, what I regard as, an trustworthy source:

------------------------------------------------------------
Seems pretty clear. At any access mode the program can be either in
non-AST or AST mode.

As long as you are very well aware of this, make certain that your
AST-mode code does whatever it does, never calls anything related
to Rdb, and then exits, you are probable just fine. Do not do
anything that might block (e.g. potential synchronous IO or similar;
explicitly avoid RMS directly or indirectly).

Best that you studiously avoid anything to do with timers or
$HIBER/$WAKE to make your future life easier.
------------------------------------------------------------

It is very much the general guidelines for any interrupt handling
on any kind of environment (have done PIC microcontroller work before).
In all cases, keep your interrupt (or AST) rooutines as short as
possible and let the main code do the processing...

We'll see. Still under investigation.

Re: Returning data from Cobol AST routine.

<sif7mu$150l$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17097&group=comp.os.vms#17097

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 22 Sep 2021 08:31:24 -0400
Organization: Aioe.org NNTP Server
Message-ID: <sif7mu$150l$1@gioia.aioe.org>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<8ba4661e-181c-48dc-9b35-a441c7e58eefn@googlegroups.com>
<sidida$fha$6@dont-email.me> <sidlue$554$1@gioia.aioe.org>
<sidntn$fha$7@dont-email.me> <sidq1e$1is3$1@gioia.aioe.org>
<sidth7$fha$8@dont-email.me> <sie1cp$1uvq$1@gioia.aioe.org>
<siemmp$qmo$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="37909"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Arne Vajhøj - Wed, 22 Sep 2021 12:31 UTC

On 9/22/2021 3:41 AM, Jan-Erik Söderholm wrote:
> Den 2021-09-22 kl. 03:37, skrev Arne Vajhøj:
>> On 9/21/2021 8:31 PM, Jan-Erik Söderholm wrote:
>>> 01  reqidt              pic 9(9)    comp.
>>> ...
>>>      move 1234 to reqidt
>>>      call "sys$setimr"
>>>          using omitted
>>>                by reference delta-time
>>>                by value ast-proc-addr
>>>                by reference reqidt    <<==
>>>                omitted
>>>          giving return-value
>>>      end-call
>>>
>>> Replaced "by value reqidt" with "by reference reqidt".
>>> That will pass the address (pointer) to reqidt.
>>> Silly not thinking about that...
>>>
>>> The AST routine just uses the paramater as-is as before
>>> an now prints "reqidt: 1234" as expected.
>>
>> I would probably have preferred to keep the formal
>> argument as by val and stuffed the address into an integer
>> and passed that. Slightly more complicated but I just
>> don't like faking the passing mechanism of a system
>> service.
>
> Not that much more complicated, one additional pointer definition:
>
> 01  reqidt_addr         pointer     value reference reqidt.
> 01  reqidt              pic 9(9)    comp.
> ...
>     move 1234 to reqidt
>
>     call "sys$setimr"
>         using omitted
>               by reference delta-time
>               by value ast-proc-addr
>               by value reqidt_addr
>               omitted
>         giving return-value
>     end-call
>
> This also works. A matter of taste, I guess. :-)

Yes. They do the same thing.

It just bother me to see a by reference when the documentation
says by value even though there is a good reason.

Arne

Re: Returning data from Cobol AST routine.

<ec777b9b-30fd-4c7e-9ed4-27c14e4f2052n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17102&group=comp.os.vms#17102

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a37:f605:: with SMTP id y5mr34997437qkj.505.1632315694112;
Wed, 22 Sep 2021 06:01:34 -0700 (PDT)
X-Received: by 2002:a37:6896:: with SMTP id d144mr12484785qkc.387.1632315693901;
Wed, 22 Sep 2021 06:01:33 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 22 Sep 2021 06:01:33 -0700 (PDT)
In-Reply-To: <siemmp$qmo$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=100.2.113.217; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 100.2.113.217
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me> <c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me> <8ba4661e-181c-48dc-9b35-a441c7e58eefn@googlegroups.com>
<sidida$fha$6@dont-email.me> <sidlue$554$1@gioia.aioe.org>
<sidntn$fha$7@dont-email.me> <sidq1e$1is3$1@gioia.aioe.org>
<sidth7$fha$8@dont-email.me> <sie1cp$1uvq$1@gioia.aioe.org> <siemmp$qmo$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec777b9b-30fd-4c7e-9ed4-27c14e4f2052n@googlegroups.com>
Subject: Re: Returning data from Cobol AST routine.
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Wed, 22 Sep 2021 13:01:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 127
 by: Bob Gezelter - Wed, 22 Sep 2021 13:01 UTC

On Wednesday, September 22, 2021 at 3:41:15 AM UTC-4, Jan-Erik Söderholm wrote:
> Den 2021-09-22 kl. 03:37, skrev Arne Vajhøj:
> > On 9/21/2021 8:31 PM, Jan-Erik Söderholm wrote:
> >> Den 2021-09-22 kl. 01:31, skrev Arne Vajhøj:
> >>> On 9/21/2021 6:55 PM, Jan-Erik Söderholm wrote:
> >>>> This ACCVIO's on the display statement. The weird thing is that
> >>>> the virtual address in the ACCVIO message is ...00042D, and that
> >>>> is the hex for the value I used, in decimal 1234.
> >>>>
> >>>> I must be missing something, it looks like the display statement tries
> >>>> to use the value in reqidt as an address instead of the actual value....
> >>>
> >>> I know next to nothing about COBOL, but if COBOL use call by ref as
> >>> default like FORTRAN, so that the AST routine expects an address,
> >>> then the error makes sense.
> >>
> >> Right. When calling *from* Cobol you can specify "by ref", "by val"
> >> and so on. I have looked but I cannot find anything similar when a
> >> Cobol routine is *called*. But yes, it very much looks like that a
> >> called Cobol routine expects a "by ref" (pointer) parameter.
> >>
> >> But the SETIMR docs says that this parameter is sent by value.
> >>
> >>> And the solution could be to call with
> >>> address of reqidt in main code (I don't know how to do that i COBOL
> >>> but it must be possible).
> >>>
> >>
> >> Good point... And that solved this issue!
> >>
> >>
> >> 01 reqidt pic 9(9) comp.
> >> ...
> >> move 1234 to reqidt
> >> call "sys$setimr"
> >> using omitted
> >> by reference delta-time
> >> by value ast-proc-addr
> >> by reference reqidt <<==
> >> omitted
> >> giving return-value
> >> end-call
> >>
> >> Replaced "by value reqidt" with "by reference reqidt".
> >> That will pass the address (pointer) to reqidt.
> >> Silly not thinking about that...
> >>
> >> The AST routine just uses the paramater as-is as before
> >> an now prints "reqidt: 1234" as expected.
> >
> > I would probably have preferred to keep the formal
> > argument as by val and stuffed the address into an integer
> > and passed that. Slightly more complicated but I just
> > don't like faking the passing mechanism of a system
> > service.
> >
> > Arne
> >
> Not that much more complicated, one additional pointer definition:
>
> 01 reqidt_addr pointer value reference reqidt.
> 01 reqidt pic 9(9) comp.
> ...
> move 1234 to reqidt
>
> call "sys$setimr"
> using omitted
> by reference delta-time
> by value ast-proc-addr
> by value reqidt_addr
> omitted
> giving return-value
> end-call
>
> This also works. A matter of taste, I guess. :-)
>
> Now, a bigger issue is that I found this in the Rdb docs:
>
> ------------------------------------------------------------
> 15.3 Avoiding Asynchronous System Traps
>
> You should not use asynchronous system trap (AST) service routines in
> an application that accesses Oracle Rdb databases. If you do, Oracle
> Rdb cannot guarantee the behavior of the application.
>
> Because several Oracle Rdb components use AST service routines and
> because an AST cannot be delivered while an AST service routine is
> currently executing at the same mode or more privileged mode, using
> an AST service routine in an application can prevent the delivery of
> an AST in one of the components of Oracle Rdb.
> ------------------------------------------------------------
>
> I posted a question on the Rdb mailing list regarding ASTs, and got
> this from, what I regard as, an trustworthy source:
>
> ------------------------------------------------------------
> Seems pretty clear. At any access mode the program can be either in
> non-AST or AST mode.
>
> As long as you are very well aware of this, make certain that your
> AST-mode code does whatever it does, never calls anything related
> to Rdb, and then exits, you are probable just fine. Do not do
> anything that might block (e.g. potential synchronous IO or similar;
> explicitly avoid RMS directly or indirectly).
>
> Best that you studiously avoid anything to do with timers or
> $HIBER/$WAKE to make your future life easier.
> ------------------------------------------------------------
>
> It is very much the general guidelines for any interrupt handling
> on any kind of environment (have done PIC microcontroller work before).
> In all cases, keep your interrupt (or AST) rooutines as short as
> possible and let the main code do the processing...
>
> We'll see. Still under investigation.
Jan-Erik,

Yes, that comment in the Oracle RDB documentation is the point that I was referring to in my DECUS seminar. The solution is to have the main thread read from an interlocked queue.

- Bob Gezelter, http://www.rlgsc.com

Re: Returning data from Cobol AST routine.

<sif9vu$7pa$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17104&group=comp.os.vms#17104

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 22 Sep 2021 09:10:20 -0400
Organization: Aioe.org NNTP Server
Message-ID: <sif9vu$7pa$1@gioia.aioe.org>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<sidhu6$fha$5@dont-email.me> <sie21v$v6s$1@dont-email.me>
<sie2al$87k$1@gioia.aioe.org> <sie2q2$20g$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="7978"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Arne Vajhøj - Wed, 22 Sep 2021 13:10 UTC

On 9/21/2021 9:59 PM, Dave Froble wrote:
> On 9/21/2021 9:53 PM, Arne Vajhøj wrote:
>> On 9/21/2021 9:46 PM, Dave Froble wrote:
>>> On 9/21/2021 5:13 PM, Jan-Erik Söderholm wrote:
>>>> But my guess is that, if you queue QIOs from multiple sources, the AST
>>>> routine must have some way to tell which source it was that trigged
>>>> the AST. Say you make (made up example, not part of our current target)
>>>> 10 QIO calls having the address of the same AST routine in the calls,
>>>> each QIO reading from its own TNA device, you need to know in the AST
>>>> routine which TNA device (like 10 different production machines) it
>>>> was that sent something.
>>>
>>> That sounds like a real headache.  Perhaps event flags would help.  I
>>> tend to avoid event flags.
>>>
>>>> I have probably not read enough aboit AST and QUI calls yet...
>>>
>>> ASTs can be fun.  I try to use them to set flags or cancel I/O.
>>> Cancelling an I/O causes a completion of an async read.  I feel that
>>> if I try to get "tricky", I'll outsmart myself,
>>
>> That is why I suggested a message queue instead of mailboxes,
>> $QIO(W) and AST's.
>
> You'd still have to check the message periodically.  Testing a flag, and
> already having the message in a buffer, should be more efficient.

Using a message queue (like IBM MQ or ActiveMQ) will avoid AST's,
avoid $QIO(W) and will avoid mailbox size limits.

But it does not solve the concurrency problem.

I would go for a thread for that.

Arne

Re: Returning data from Cobol AST routine.

<af59eb6a-dfc3-4a9f-acfb-86d497ecaf6fn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17106&group=comp.os.vms#17106

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a0c:c2c4:: with SMTP id c4mr25118644qvi.30.1632316945553;
Wed, 22 Sep 2021 06:22:25 -0700 (PDT)
X-Received: by 2002:a05:620a:4001:: with SMTP id h1mr35626352qko.454.1632316945410;
Wed, 22 Sep 2021 06:22:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 22 Sep 2021 06:22:25 -0700 (PDT)
In-Reply-To: <sie21v$v6s$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=100.2.113.217; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 100.2.113.217
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me> <c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me> <sidhu6$fha$5@dont-email.me>
<sie21v$v6s$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <af59eb6a-dfc3-4a9f-acfb-86d497ecaf6fn@googlegroups.com>
Subject: Re: Returning data from Cobol AST routine.
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Wed, 22 Sep 2021 13:22:25 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 62
 by: Bob Gezelter - Wed, 22 Sep 2021 13:22 UTC

On Tuesday, September 21, 2021 at 9:48:49 PM UTC-4, Dave Froble wrote:
(Omitted for the sake of brevity)
> However, I'm not sure you'd have anything to do in the AST routine,
> since I'm assuming you're going to queue up an async read from the main
> program, and then continue with whatever the main program is doing.
> When the AST fires, it lets you know that the read completed, in some
> fashion, and now the message is in whatever buffer in the main program.
> I'd assume some flag is set, bu the AST routine, and periodically the
> main program tests the flag, and processes the message, at that time.
>
> Which brings up this question. How many mailboxes are you using? A
> single mailbox? Or multiple mailboxes (that's a real headache).
> >> For sharing data, what I have not tried, but I'd be tempted, is to
> >> declare some structure, in Basic it would be a RECORD, and pass the
> >> address (By Ref) to the AST routine, which also would have an
> >> identical RECORD definition, such that the two (main and AST routine)
> >> can both share the data in the structure. All that would be required,
> >> I think, is some variable that can be passed, By Ref, to the AST routine.
> >>
> >
> > I have not read up that much yet to see if there is any other information
> > you can pass, besides of the address to the AST routine.
> You mentioned elsewhere that you're unaware of how to define the
> datatype of an incoming argument. I've done this in Basic. Then the
> AST routine just uses the labels in the structure definition. The
> address is the address of the first variable defined in the structure.
> > But my guess is that, if you queue QIOs from multiple sources, the AST
> > routine must have some way to tell which source it was that trigged
> > the AST. Say you make (made up example, not part of our current target)
> > 10 QIO calls having the address of the same AST routine in the calls,
> > each QIO reading from its own TNA device, you need to know in the AST
> > routine which TNA device (like 10 different production machines) it
> > was that sent something.
> That sounds like a real headache. Perhaps event flags would help. I
> tend to avoid event flags.
> > I have probably not read enough aboit AST and QUI calls yet...
> ASTs can be fun. I try to use them to set flags or cancel I/O.
> Cancelling an I/O causes a completion of an async read. I feel that if
> I try to get "tricky", I'll outsmart myself, not so hard to do with dumb
> Dave.
>
> :-)
> --
> David Froble Tel: 724-529-0450
> Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
> DFE Ultralights, Inc.
> 170 Grimplin Road
> Vanderbilt, PA 15486
Dave.

Distinguishing between multiple sources using the same AST routine is straightforward. OpenVMS nee VAX/VMS QIO has a parameter referred to as ASTPARM (ASTPARM was added to the QIO interface with VAX/VMS; the RSX-11 family QIO did not have ASTPARM).

ASTPARM is an untyped longword. It can be:
- a buffer pointer (where the buffer structure includes a pointer to an owning data structure)
- a pointer to a data structure
- an index into a table of pointers

I have done code which had hundreds (or more) active IO connections active simultaneously using this technique with absolutely no problems.

Straightforward to say the least.

- Bob Gezelter, http://www.rlgsc.com

Re: Returning data from Cobol AST routine.

<sifko6$1rv$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17119&group=comp.os.vms#17119

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 22 Sep 2021 12:12:03 -0400
Organization: A noiseless patient Spider
Lines: 78
Message-ID: <sifko6$1rv$1@dont-email.me>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<sidhu6$fha$5@dont-email.me> <sie21v$v6s$1@dont-email.me>
<af59eb6a-dfc3-4a9f-acfb-86d497ecaf6fn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 Sep 2021 16:13:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="357520f68e0c5ae9cbcf58c098d199b9";
logging-data="1919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vpFqatNjYt6AOXKxTPFW1+l0Kr+Gx7Zs="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:1iKpeEVnO6U+bonjJtBKftwuU1w=
In-Reply-To: <af59eb6a-dfc3-4a9f-acfb-86d497ecaf6fn@googlegroups.com>
 by: Dave Froble - Wed, 22 Sep 2021 16:12 UTC

On 9/22/2021 9:22 AM, Bob Gezelter wrote:
> On Tuesday, September 21, 2021 at 9:48:49 PM UTC-4, Dave Froble wrote:
> (Omitted for the sake of brevity)
>
>> However, I'm not sure you'd have anything to do in the AST routine,
>> since I'm assuming you're going to queue up an async read from the main
>> program, and then continue with whatever the main program is doing.
>> When the AST fires, it lets you know that the read completed, in some
>> fashion, and now the message is in whatever buffer in the main program.
>> I'd assume some flag is set, bu the AST routine, and periodically the
>> main program tests the flag, and processes the message, at that time.
>>
>> Which brings up this question. How many mailboxes are you using? A
>> single mailbox? Or multiple mailboxes (that's a real headache).
>>>> For sharing data, what I have not tried, but I'd be tempted, is to
>>>> declare some structure, in Basic it would be a RECORD, and pass the
>>>> address (By Ref) to the AST routine, which also would have an
>>>> identical RECORD definition, such that the two (main and AST routine)
>>>> can both share the data in the structure. All that would be required,
>>>> I think, is some variable that can be passed, By Ref, to the AST routine.
>>>>
>>>
>>> I have not read up that much yet to see if there is any other information
>>> you can pass, besides of the address to the AST routine.
>> You mentioned elsewhere that you're unaware of how to define the
>> datatype of an incoming argument. I've done this in Basic. Then the
>> AST routine just uses the labels in the structure definition. The
>> address is the address of the first variable defined in the structure.
>>> But my guess is that, if you queue QIOs from multiple sources, the AST
>>> routine must have some way to tell which source it was that trigged
>>> the AST. Say you make (made up example, not part of our current target)
>>> 10 QIO calls having the address of the same AST routine in the calls,
>>> each QIO reading from its own TNA device, you need to know in the AST
>>> routine which TNA device (like 10 different production machines) it
>>> was that sent something.
>> That sounds like a real headache. Perhaps event flags would help. I
>> tend to avoid event flags.
>>> I have probably not read enough aboit AST and QUI calls yet...
>> ASTs can be fun. I try to use them to set flags or cancel I/O.
>> Cancelling an I/O causes a completion of an async read. I feel that if
>> I try to get "tricky", I'll outsmart myself, not so hard to do with dumb
>> Dave.
>>
>> :-)
>> --
>> David Froble Tel: 724-529-0450
>> Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
>> DFE Ultralights, Inc.
>> 170 Grimplin Road
>> Vanderbilt, PA 15486
> Dave.
>
> Distinguishing between multiple sources using the same AST routine is straightforward. OpenVMS nee VAX/VMS QIO has a parameter referred to as ASTPARM (ASTPARM was added to the QIO interface with VAX/VMS; the RSX-11 family QIO did not have ASTPARM).
>
> ASTPARM is an untyped longword. It can be:
> - a buffer pointer (where the buffer structure includes a pointer to an owning data structure)
> - a pointer to a data structure
> - an index into a table of pointers
>
> I have done code which had hundreds (or more) active IO connections active simultaneously using this technique with absolutely no problems.
>
> Straightforward to say the least.
>
> - Bob Gezelter, http://www.rlgsc.com
>

I was looking at that argument in the docs just last night. I was
figuring that while the docs declared the argument read only, if it was
the address of some data, the AST could access and modify the data,
assuming it was aware of the size of the data. Then I thought a bit
more about that "aware of the size of the data" and suffered a few shakes.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: Returning data from Cobol AST routine.

<sifrg4$m2r$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17133&group=comp.os.vms#17133

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: seaoh...@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 22 Sep 2021 14:09:08 -0400
Organization: HoffmanLabs LLC
Lines: 34
Message-ID: <sifrg4$m2r$1@dont-email.me>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org> <sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org> <siclc8$fha$1@dont-email.me> <c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com> <sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me> <sidhu6$fha$5@dont-email.me> <sie21v$v6s$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="8ae4c2d243194a34d823eb00b433ddef";
logging-data="22619"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//ZIrJCFCbtxc0ZuFilM4lYEuRW9lRBhg="
User-Agent: Unison/2.2
Cancel-Lock: sha1:00pWKhFkod09CSJ5e5cC0WKem2s=
 by: Stephen Hoffman - Wed, 22 Sep 2021 18:09 UTC

On 2021-09-22 01:46:20 +0000, Dave Froble said:

> On 9/21/2021 5:13 PM, Jan-Erik Söderholm wrote:
>
>> But my guess is that, if you queue QIOs from multiple sources, the AST
>> routine must have some way to tell which source it was that trigged the
>> AST. Say you make (made up example, not part of our current target) 10
>> QIO calls having the address of the same AST routine in the calls, each
>> QIO reading from its own TNA device, you need to know in the AST
>> routine which TNA device (like 10 different production machines) it was
>> that sent something.
>
> That sounds like a real headache. Perhaps event flags would help. I
> tend to avoid event flags.

The AST parameter is used for that. This is why I pass around that
context block (data buffer(s), the IOSB, other app-specific data, etc),
and why I requeue the context block to pass around the data.

>> I have probably not read enough aboit AST and QUI calls yet...
>
> ASTs can be fun. I try to use them to set flags or cancel I/O.
> Cancelling an I/O causes a completion of an async read. I feel that if
> I try to get "tricky", I'll outsmart myself, not so hard to do with
> dumb Dave.

Yes; setting a "cancel in progress" bitlock in the app context for that
processing is the wise way to go here, too. Chasing $cancel requests
around is less than fun.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: Returning data from Cobol AST routine.

<0d913021-656d-4333-85cf-9855124c33bfn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17148&group=comp.os.vms#17148

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:1190:: with SMTP id d16mr2454394qtj.391.1632361277312;
Wed, 22 Sep 2021 18:41:17 -0700 (PDT)
X-Received: by 2002:a05:622a:612:: with SMTP id z18mr2517385qta.330.1632361277212;
Wed, 22 Sep 2021 18:41:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 22 Sep 2021 18:41:16 -0700 (PDT)
In-Reply-To: <sif9vu$7pa$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=118.93.180.215; posting-account=Rx7iEQoAAACMdczcZGHsDFakQWn8-8-t
NNTP-Posting-Host: 118.93.180.215
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me> <c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me> <sidhu6$fha$5@dont-email.me>
<sie21v$v6s$1@dont-email.me> <sie2al$87k$1@gioia.aioe.org>
<sie2q2$20g$1@dont-email.me> <sif9vu$7pa$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0d913021-656d-4333-85cf-9855124c33bfn@googlegroups.com>
Subject: Re: Returning data from Cobol AST routine.
From: lawrence...@gmail.com (Lawrence D’Oliveiro)
Injection-Date: Thu, 23 Sep 2021 01:41:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 8
 by: Lawrence D’Oliveir - Thu, 23 Sep 2021 01:41 UTC

On Thursday, September 23, 2021 at 1:10:24 AM UTC+12, Arne Vajhøj wrote:

> Using a message queue (like IBM MQ or ActiveMQ) will avoid AST's,
> avoid $QIO(W) and will avoid mailbox size limits.
>
> But it does not solve the concurrency problem.

Do you have access to modern languages with async/await functionality?

Re: Returning data from Cobol AST routine.

<siiqrj$phs$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17181&group=comp.os.vms#17181

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Thu, 23 Sep 2021 17:16:33 -0400
Organization: Aioe.org NNTP Server
Message-ID: <siiqrj$phs$1@gioia.aioe.org>
References: <sib3g6$7rj$1@dont-email.me> <sibcea$1jrk$1@gioia.aioe.org>
<sic0q4$ap3$1@dont-email.me> <sicl24$1ib$1@gioia.aioe.org>
<siclc8$fha$1@dont-email.me>
<c37686b5-ba60-4471-a8e5-6186323d49f3n@googlegroups.com>
<sicmp8$fha$2@dont-email.me> <sid7t2$op0$1@dont-email.me>
<sidhu6$fha$5@dont-email.me> <sie21v$v6s$1@dont-email.me>
<sie2al$87k$1@gioia.aioe.org> <sie2q2$20g$1@dont-email.me>
<sif9vu$7pa$1@gioia.aioe.org>
<0d913021-656d-4333-85cf-9855124c33bfn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="26172"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Arne Vajhøj - Thu, 23 Sep 2021 21:16 UTC

On 9/22/2021 9:41 PM, Lawrence D’Oliveiro wrote:
> On Thursday, September 23, 2021 at 1:10:24 AM UTC+12, Arne Vajhøj wrote:
>> Using a message queue (like IBM MQ or ActiveMQ) will avoid AST's,
>> avoid $QIO(W) and will avoid mailbox size limits.
>>
>> But it does not solve the concurrency problem.
>
> Do you have access to modern languages with async/await functionality?

CPython 3.8 and Kotlin/JVM runs on VMS Itanium.

But I am not aware of anything for native code on VMS Alpha.

But a good oldfashioned explicit thread may still work.

Arne

Re: Returning data from Cobol AST routine.

<6abc14aa-73bf-477a-a722-40d8cbdee1b9n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17213&group=comp.os.vms#17213

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:7dc7:: with SMTP id c7mr4654895qte.0.1632494935490;
Fri, 24 Sep 2021 07:48:55 -0700 (PDT)
X-Received: by 2002:a37:9a4f:: with SMTP id c76mr11092273qke.17.1632494935270;
Fri, 24 Sep 2021 07:48:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Fri, 24 Sep 2021 07:48:55 -0700 (PDT)
In-Reply-To: <sib3g6$7rj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=24.147.72.155; posting-account=U1iMPAoAAAC9r8wm0KaW63EcF8sfjFeH
NNTP-Posting-Host: 24.147.72.155
References: <sib3g6$7rj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6abc14aa-73bf-477a-a722-40d8cbdee1b9n@googlegroups.com>
Subject: Re: Returning data from Cobol AST routine.
From: heinvand...@gmail.com (Hein RMS van den Heuvel)
Injection-Date: Fri, 24 Sep 2021 14:48:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 44
 by: Hein RMS van den Heu - Fri, 24 Sep 2021 14:48 UTC

On Monday, September 20, 2021 at 6:55:06 PM UTC-4, Jan-Erik Söderholm wrote:
> Hi.
>
> I have been looking at the Cobol AST example here:
> http://computer-programming-forum.com/48-cobol/b75d8c5fdd43048e.htm
>
> This does work fine as an example. But what are the options to get
> some data back to the main program (called "x" in the example)
> from the ast program (called "ast_routine" in the example)?
>
> I have tried different versions of global, external and so on, but
> no luck so far. How to get "x" and "ast_routine" to share some data?
> Anything similar to an COMMON area in Fortran?

External should have worked - it applies to a whole 01 'record structure' and can have integers, number, text in any any grouping.

If you have access to a server with DECforms installed - or at least the HELP structure you can find a detailed COBOL + AST example in the files FORMS$EXAMPLE:forms$demo_timer*.COB

> The idea is to have an AST routine that will read from a mailbox when
> something is written to it. My idea was that the read of the mailbox
> would be using an AST to avoid polling the mailbox.
>
> This is to have a command input to detached processes to get them to
> reload the config, repoen the log file, close and exit and so on.

You received a bunch of answers, mostly over the top - insque and the works..
Sure that allows (and is required) for a solid solution but adds no value here.

Just have the AST routing plunk a command in shared 'external' memory.
Initialize with 'moves spaces'.
Have the main loop test for non-spaces
If found - log, interpret, execute, and set back spaces.
In the AST routine you _might_ want test that the shared command buffer is indeed set to spaces before moving in a new command.

Hope this helps,
Hein

Re: Returning data from Cobol AST routine.

<e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17360&group=comp.os.vms#17360

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a37:7c5:: with SMTP id 188mr4160157qkh.408.1632906741093;
Wed, 29 Sep 2021 02:12:21 -0700 (PDT)
X-Received: by 2002:ac8:4585:: with SMTP id l5mr10418605qtn.93.1632906740918;
Wed, 29 Sep 2021 02:12:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 29 Sep 2021 02:12:20 -0700 (PDT)
In-Reply-To: <sib3g6$7rj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=110.141.199.187; posting-account=aiFgKwoAAADhXN8yuY9GOUK5pPhh21wH
NNTP-Posting-Host: 110.141.199.187
References: <sib3g6$7rj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com>
Subject: Re: Returning data from Cobol AST routine.
From: andrew.c...@bigpond.com (Andrew Commons)
Injection-Date: Wed, 29 Sep 2021 09:12:21 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 22
 by: Andrew Commons - Wed, 29 Sep 2021 09:12 UTC

I did this many years ago in MACRO32.

The main program set up two queues:

(a) An empty work queue
(b) A buffer queue primed with some arbitrary number of buffers.

The queues were managed using INSQUE/REMQUE.

Main pulls a buffer from the buffer queue, QIOs the mailbox with AST
routine with queue headers as AST param, then $HIBERs.

On wake it pulls buffer from the work queue and processes it putting the
buffer on the end of the free queue when done. Loop until work is
empty then $HIBER.

The AST routine puts the filled buffer on the end of the work queue,
pulls a buffer from the free queue, QIOs the mailbox, $WAKE, and returns.

Volume was low so didn't have to worry about running out of buffers

The LIB$ routines give you access to the instructions so this should
be possible in COBOL.

Re: Returning data from Cobol AST routine.

<sj274l$j7t$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17371&group=comp.os.vms#17371

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: seaoh...@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 29 Sep 2021 13:18:13 -0400
Organization: HoffmanLabs LLC
Lines: 16
Message-ID: <sj274l$j7t$1@dont-email.me>
References: <e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="7e6e6a2053459dcf96c0ed00bcfea5ef";
logging-data="19709"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MG4ML6UFAFcIyluy+60CwErbKVm6eA5M="
User-Agent: Unison/2.2
Cancel-Lock: sha1:a5hEHYhdf/Kp3r1Vd+K2V6g+ZB0=
 by: Stephen Hoffman - Wed, 29 Sep 2021 17:18 UTC

On 2021-09-29 09:12:20 +0000, Andrew Commons said:

> I did this many years ago in MACRO32.
> ...
> The queues were managed using INSQUE/REMQUE.

INSQUE and REMQUE are interruptable. Best use equivalent the
interlocked queue operations INSQ*I and REMQ*I. Which are not.

I've used this AST design for SCADA work, and in various other
projects, and it has worked well. I'd use KP Threads now, but ASTs were
then what was.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: Returning data from Cobol AST routine.

<f6d8b77d-e891-40d7-b1a2-aa19b7b60020n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17385&group=comp.os.vms#17385

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:4156:: with SMTP id e22mr3077729qtm.195.1632963704793;
Wed, 29 Sep 2021 18:01:44 -0700 (PDT)
X-Received: by 2002:a37:c0c:: with SMTP id 12mr2543083qkm.471.1632963704665;
Wed, 29 Sep 2021 18:01:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 29 Sep 2021 18:01:44 -0700 (PDT)
In-Reply-To: <sj274l$j7t$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=110.141.199.187; posting-account=aiFgKwoAAADhXN8yuY9GOUK5pPhh21wH
NNTP-Posting-Host: 110.141.199.187
References: <e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com> <sj274l$j7t$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f6d8b77d-e891-40d7-b1a2-aa19b7b60020n@googlegroups.com>
Subject: Re: Returning data from Cobol AST routine.
From: andrew.c...@bigpond.com (Andrew Commons)
Injection-Date: Thu, 30 Sep 2021 01:01:44 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: Andrew Commons - Thu, 30 Sep 2021 01:01 UTC

On Thursday, 30 September 2021 at 2:48:15 am UTC+9:30, Stephen Hoffman wrote:
> On 2021-09-29 09:12:20 +0000, Andrew Commons said:

> INSQUE and REMQUE are interruptable. Best use equivalent the
> interlocked queue operations INSQ*I and REMQ*I. Which are not.
>
The distinction between the instructions is the type of queue they handle.

From the manual:

"Both INSQUE and REMQUE are implemented as noninterruptible instructions."

Re: Returning data from Cobol AST routine.

<sj356t$ueh$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17388&group=comp.os.vms#17388

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: seaoh...@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 29 Sep 2021 21:51:25 -0400
Organization: HoffmanLabs LLC
Lines: 51
Message-ID: <sj356t$ueh$1@dont-email.me>
References: <sib3g6$7rj$1@dont-email.me> <e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com> <sj274l$j7t$1@dont-email.me> <f6d8b77d-e891-40d7-b1a2-aa19b7b60020n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="1471b5c100eea2df781f887dc50b9f84";
logging-data="31185"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sIkcWIe9DAU9gFt/VNtZPOx9kwDhUdYY="
User-Agent: Unison/2.2
Cancel-Lock: sha1:jnCGFJn/8ycjEvv8EWCOaNFEkJY=
 by: Stephen Hoffman - Thu, 30 Sep 2021 01:51 UTC

On 2021-09-30 01:01:44 +0000, Andrew Commons said:

> On Thursday, 30 September 2021 at 2:48:15 am UTC+9:30, Stephen Hoffman wrote:
>> On 2021-09-29 09:12:20 +0000, Andrew Commons said:
>
>> INSQUE and REMQUE are interruptable. Best use equivalent the
>> interlocked queue operations INSQ*I and REMQ*I. Which are not.
>>
> The distinction between the instructions is the type of queue they handle.
>
> From the manual:
>
> "Both INSQUE and REMQUE are implemented as noninterruptible instructions."

Yeah, you're right. INSQUE and REMQUE are non-interruptible within the
context of a single processor. But they're concurrent within the
context of a multiprocessor. And with no visibility within the
multiprocessor memory caching. Which in aggregate leads to some
hard-to-debug surprises.

See chapters 5 and 6 for a start:
https://vmssoftware.com/docs/VSI_PROGRAM_CONCEPTS_VOL_I.pdf

Also scrounge up a copy of EL-00032-00 DEC Standard 32, and see section
3.8 (page 3-95ff) and chapter 7 (e.g. section 7.1.4, using interlocks
to prevent the corruption of shared data ):

http://www.bitsavers.org/pdf/dec/vax/archSpec/EL-00032-00-decStd32_Jan90.pdf

If your app code stays strictly on one processor and forever avoids
concurrent access to the structures within an SMP system, you can get
away with INSQUE and REMQUE.

Just as soon as the queue becomes shared across processors (KP threads,
multiprocessing), not so much.

I've chased enough of these sync bugs over the years that I'll usually
avoid REMQUE and INSQUE in preference for using INSQHI, INSQTI, REMQHI,
REMQTI, etc.

Another advantage of using INSQHI, INSQTI, REMQHI, REMQTI, etc, is
relative addressing, which means any process or global sections
involved can be mapped at different address ranges in different
processes. Which is really handy.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: Returning data from Cobol AST routine.

<sj37rj$auj$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17391&group=comp.os.vms#17391

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: Returning data from Cobol AST routine.
Date: Wed, 29 Sep 2021 22:33:50 -0400
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <sj37rj$auj$2@dont-email.me>
References: <sib3g6$7rj$1@dont-email.me>
<e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com>
<sj274l$j7t$1@dont-email.me>
<f6d8b77d-e891-40d7-b1a2-aa19b7b60020n@googlegroups.com>
<sj356t$ueh$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 30 Sep 2021 02:36:35 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fef11f99dae51837181ac4d219873943";
logging-data="11219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VNxtVLpjxKLHHKVcKqbQYs0Imif89Qd4="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:USGCrdB2ZqdkD/eNlxmUqubAxCU=
In-Reply-To: <sj356t$ueh$1@dont-email.me>
 by: Dave Froble - Thu, 30 Sep 2021 02:33 UTC

On 9/29/2021 9:51 PM, Stephen Hoffman wrote:
> On 2021-09-30 01:01:44 +0000, Andrew Commons said:
>
>> On Thursday, 30 September 2021 at 2:48:15 am UTC+9:30, Stephen Hoffman
>> wrote:
>>> On 2021-09-29 09:12:20 +0000, Andrew Commons said:
>>
>>> INSQUE and REMQUE are interruptable. Best use equivalent the
>>> interlocked queue operations INSQ*I and REMQ*I. Which are not.
>>>
>> The distinction between the instructions is the type of queue they
>> handle.
>>
>> From the manual:
>>
>> "Both INSQUE and REMQUE are implemented as noninterruptible
>> instructions."
>
> Yeah, you're right. INSQUE and REMQUE are non-interruptible within the
> context of a single processor. But they're concurrent within the context
> of a multiprocessor. And with no visibility within the multiprocessor
> memory caching. Which in aggregate leads to some hard-to-debug surprises.

Yeah, multi-processors, and multi-cores, really changes the game. Some
concepts from the single CPU era just don't work too well anymore.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: Returning data from Cobol AST routine.

<yv95J.64122$tG6.25360@fx39.iad>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17393&group=comp.os.vms#17393

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx39.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.2
Subject: Re: Returning data from Cobol AST routine.
Content-Language: en-US
Newsgroups: comp.os.vms
References: <e21786a0-8cc5-430b-a507-49204b577e55n@googlegroups.com>
<sj274l$j7t$1@dont-email.me>
<f6d8b77d-e891-40d7-b1a2-aa19b7b60020n@googlegroups.com>
From: lee.glea...@comcast.net (Lee Gleason)
In-Reply-To: <f6d8b77d-e891-40d7-b1a2-aa19b7b60020n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: Avast (VPS 210929-8, 9/29/2021), Outbound message
X-Antivirus-Status: Clean
Lines: 23
Message-ID: <yv95J.64122$tG6.25360@fx39.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Thu, 30 Sep 2021 02:43:42 UTC
Organization: usenet-news.net
Date: Wed, 29 Sep 2021 21:43:42 -0500
X-Received-Bytes: 1901
 by: Lee Gleason - Thu, 30 Sep 2021 02:43 UTC

On 9/29/2021 8:01 PM, Andrew Commons wrote:
> On Thursday, 30 September 2021 at 2:48:15 am UTC+9:30, Stephen Hoffman wrote:
>> On 2021-09-29 09:12:20 +0000, Andrew Commons said:
>
>> INSQUE and REMQUE are interruptable. Best use equivalent the
>> interlocked queue operations INSQ*I and REMQ*I. Which are not.
>>
> The distinction between the instructions is the type of queue they handle.
>
> From the manual:
>
> "Both INSQUE and REMQUE are implemented as noninterruptible instructions."
>

Perhaps he didn't mean non-interruptible - he meant that INSQUE and
REMQUE are not multiprocessor safe, and INSQ*I and REMQ*I are. BY
multiprocessor safe, I mean they can be used in a multiprocessor
environment without additional means of synchronization of access.

--
Lee K. Gleason N5ZMR
Control-G Consultants
lee.gleason@comcast.net

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor