|
> The question is: how can the [RPG] program know which is the correct JVM to > attach > to? For example, there may be a requirement always to attach to a given WAS > JVM instance. I suppose an alternative would be to customize the WAS > instance, on start up, to call out to RPG in order to insure that the WAS > instance is known to RPG. Alexei is right. You can only "attach" your thread of execution to a JVM that is in the same process (i.e. *JOB) with you. IIRC, the RPG->Java runtime creates the JVM only if it needs to, and will use an existing JVM if one is found. (That's what the JNI_GetCreatedJavaVMs stuff is doing). So, yup, you could call an RPG native method in a class running in WAS, and theoretically that RPG native method can use the nifty RPG->Java codings to get back into Java. BUT, it becomes YOUR responsibility to understand the *extra* synchronization required by RPG in this context. Java is inherently threaded, often very widely in a webserver, so the *MODULE-level mutual exclusion in RPG could definitely "surprise" your webserver if it presumed a certain inter-task "independence" at runtime. (I'm not saying it does... Just speculating.) I mean, suppose a webserver decided that some "request handling" task was sufficiently isolated that it could "hand out" the task to many parallel threads. The webserver would expect a nearly linear speedup, up to and depending on the number of physical processors on the machine, but could be stymied if there was a "thread join" going on "under the covers." And, as has already been noted, leaving out the H THREAD(*SERIALIZE) is perilous behavior, indeed. HTH. -blair Blair Wyman -- iSeries JVM -- (507) 253-2891 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "It is a sobering thought that when Mozart was my age, he had been dead for two years." -- Tom Lehrer
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.