Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-24 Thread Steve Austin
Thanks for all your responses. To get the JNI routine to work I made the assembler routine re-entrant and linked the JNI routine RENT; the JNI routine now resides in key=0 storage. -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Paul Gilmartin
On Thu, 16 Feb 2023 00:08:07 +, Seymour J Metz wrote: >Yes, that would break. That's one of the scenarios where you would need to use >the Linkage Editor. > That would have seemed to provide a compatibility argument against having made the change to a hierarchy. Was there any benefit in

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
I thought that IBM had rewritten all of their code that did that long ago. From: IBM Mainframe Discussion List on behalf of Attila Fogarasi Sent: Wednesday, February 15, 2023 5:47 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Are JNI required to be

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
Yes, that would break. That's one of the scenarios where you would need to use the Linkage Editor. From: IBM Mainframe Discussion List on behalf of Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu> Sent: Wednesday, February 15, 2023 6:59

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Paul Gilmartin
On Wed, 15 Feb 2023 23:10:53 +, Seymour J Metz wrote: >... >Reentrant: You can invoke the module concurrently from multiple tasks and get >correct results. The code is responsible for any necessary serialization. > >Refreshable: The module gets correct results even if the OS replaces it

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
If A and B are marked serially reusable, A sometimes does a LINK to B and B sometimes does a LINK to A then a deadlock is likely. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
Serial reusable: a task can load the module, call it, then call it again and get correct results. The OS will seralize LINK to the module from different tasks. Reentrant: You can invoke the module concurrently from multiple tasks and get correct results. The code is responsible for any

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Paul Gilmartin
On Wed, 15 Feb 2023 14:06:15 -0800, Michael Stein wrote: >... >This used to be documented, see page 26 of GC28-0683-3 OS/VS2 MVS >Supervisor Services and Macro Instructions which says: > > If the module is serially reusable, only one copy is ever placed > in the job pack area; this copy is

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
Reentrant means that it works correctly when multiple tasks are using it concurrently. Refreshable means that it works correctly even if the OS replaces it with a clean copy. As an example of a routine that is reentrant but not refreshable, consider a routine that contains a data area and

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Andrew Rowley
On 14/02/2023 1:53 am, Steve Austin wrote: Yes you are correct, and the assembler program would need to be added to the program class. I had had hoped to find documentation to confirm what I've seen and maybe find a way around it, but no luck so far. I don't have exact documentation to hand, but

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Attila Fogarasi
Very simple: reentrant module is allowed to modify itself, provided it uses locking to serialize execution by multiple tasks using that module. Very common technique in system code. Refreshable cannot do that as it could be refreshed at any time (which would change the locked/serialized data

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
Right, and if it's marked that way then there should be no issue if there is a separate LINK or LOAD for each use, or at least if there is an issue I don't understand what it is. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Andrew Rowley
On 16/02/2023 6:40 am, Steve Smith wrote: If you're confused, it's probable that you didn't read all his words. The OP did say that the assembler module is *known* to be not reusable i.e. each call needs a new copy. Speculation about *maybe* it's not reusable and whether that was intended

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Rob Schramm
Ok.. so I am not sure I ever asked this question... What is the real difference between reentrant and refreshable .. as in an example? It is not clear what the distinction actually is. Rob On Wed, Feb 15, 2023, 16:34 Attila Fogarasi wrote: > IBM documents this crisply at >

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Mike Schwab
If you init fields that are updated it should work as serially reusable. If you work with getmain storage then it would be reentrant. If results are dependent on the value in the load module and it gets changed, you have to reload each time. On Wed, Feb 15, 2023 at 4:06 PM Michael Stein wrote: >

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Michael Stein
I don't know JNI or how it fetches the non-reusable routine, however: > > Maybe I'm mis-using the term "reusable". I'm not referring to "serially > > reusable" (by which the OS manages attempts to fetch the same module again > > while it still known to be in use). I don't believe it will fetch

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Attila Fogarasi
IBM documents this crisply at https://www.ibm.com/docs/en/zos/2.1.0?topic=modules-module-reusability Bottom line is that there are only 3 variants: serially reusable, reentrant and refreshable. Non-serially reusable is reentrant, but that term isn't used in Binder or z/OS doc (thankfully). On

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Phil Smith III
I feel stoopid[er than usual]: I don't understand the difference between "serially reusable" vs. "reusable" vs. "reentrant" in this context. I know what the first and last one are, but it seems like the middle one should be the same as one of the others. Unless the difference between the

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
Or maybe you didn't. It a fresh copy is loaded then why does it matter that a different copy was previously used? From: IBM Mainframe Discussion List on behalf of Steve Smith Sent: Wednesday, February 15, 2023 2:40 PM To: IBM-MAIN@LISTSERV.UA.EDU

Auto: Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Frederic Mancini
Je suis absent du 15 février 2023 au 15 mars 2023 inclus. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Steve Smith
If you're confused, it's probable that you didn't read all his words. sas On Wed, Feb 15, 2023 at 12:20 PM Seymour J Metz wrote: > I don't understand your reply. If the module is not marked as serially > reusable, then doesn't every LINK or LOAD get a fresh copy? > > > -- > Shmuel (Seymour J.)

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Seymour J Metz
I don't understand your reply. If the module is not marked as serially reusable, then doesn't every LINK or LOAD get a fresh copy? -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-15 Thread Peter Relson
>OP stated that it is not reusable. Maybe I'm mis-using the term "reusable". I'm not referring to "serially reusable" (by which the OS manages attempts to fetch the same module again while it still known to be in use). I'm referring to simply using it once and then using it again. I'm

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-14 Thread Seymour J Metz
OP stated that it is not reusable. Regrettable, but he's stuck with it. Your guess of a DS that the code assumes is initialized seems plausible. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Discussion List

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-14 Thread Peter Relson
Steve Austin wrote >as the 1st call works and subsequent calls fail in the assembler routine. That's a bit surprising to me. It's usually concurrent calls that fail due to reentrancy issues of a non-reentrant module, not "subsequent calls". So while the concurrency case is quite possibly still

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-13 Thread Steve Austin
Yes you are correct, and the assembler program would need to be added to the program class. I had had hoped to find documentation to confirm what I've seen and maybe find a way around it, but no luck so far. -Original Message- From: IBM Mainframe Discussion List

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-13 Thread Seymour J Metz
If it's not reusable then you might as well use a LINK[X]. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of Steve Austin [steve.aus...@macro4.com] Sent: Monday, February

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-13 Thread Steve Austin
I'm pretty sure I could do that, even if it meant retaining the address using name/token services. However, the assembler program is not re-usable, so I need a fresh copy for each call. -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of

Re: Are JNI required to be re-entrant and/or re-usable?

2023-02-13 Thread Seymour J Metz
Does the Java runtime allow loading and stashing the address of the routine he first time you need it and serializing access to it? -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU]

Are JNI required to be re-entrant and/or re-usable?

2023-02-13 Thread Steve Austin
I have a Java JNI routine written in C and used as a wrapper to a venerable assembler program. The assembler program is neither re-entrant or reusable and to reflect this the JNI routine is linked RENT=NO and REUS=NO. However, the RENT=NO and REUS=NO does not appear to be being honoured, as the