[Oorexx-devel] Uninits not running

2009-06-14 Thread Rony G. Flatscher
Currently, the BSF4Rexx.dll works as intended, if Rexx scripts are
started via rexx.exe, and the dll is loaded via rexx.exe. The loader
function runs when BSF4Rexx gets loaded, the uninits and the unloader
function run, upon termination of the Rexx script.

In use case # 2, Java loads BSF4Rexx.dll, creates an interpreter
instance (which causes the loader function for BSF4Rexx to run) and
executes Rexx scripts via that instance. When the interpreter instance
terminates, no uninits nor the unloader function runs.

So far, I have not been able to figure out why use case # 2 would
exhibit this deviating behaviour. Just wanted to add the info that the
uninits are not run either upon termination of that Rexx instance.

Again, any ideas of what might cause this or what I may do to corner
that problem are highly appreciated!

---rony



--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Uninits not running

2009-06-14 Thread Rick McGuire
All of the symptoms you describe would suggest you are not terminating
your interpreter instances correctly...but that's what I suggested
earlier...

Rick

On Sun, Jun 14, 2009 at 6:40 AM, Rony G.
Flatscherrony.flatsc...@wu-wien.ac.at wrote:
 Rick McGuire wrote:

 I've already given you my theories as to why the unloaders might not
 be running, but you've already discounted the theory.

 No, but unfortunately I could not take advantage of it such that it has
 become possible for me to pin the problem down and in turn becoming able to
 fix the behavior!
 :(

 If I have something to debug, then I can probably give you an answer in
 fairly short order.


 That would be really just great! Currently, I am in the midst of a fairly
 major change (which at the same time affects the dll but also the supporting
 Java classes), such that it will take me until this evening to arrive at a
 stable milestone again. If I may, I would then create a debug package with
 a nutshell example.

 As for the uninits not running, if you were anchoring the objects in
 .environment, then those objects will never be eligible for garbage
 collection, since that directly never gets garbage collected and CAN'T
 be garbage collected, since you need that directory available to be
 able to run the uninits in the first place.


 Yes, I understand that.

 In this case none of the Rexx objects are saved in .environment (nor in
 .local). The uninits run if the Rexx scripts are invoked via rexx.exe, they
 do not run for the same objects if the Rexx script is invoked via Java
 causing the following native code to be executed:

 RexxRoutineObject rro=rtc-NewRoutine(c_fileName, c_programData, len);
 if (rro==NULL)  // something went wrong, condition will be set
 {
break;
 }
 result_obj=rtc-CallRoutine(rro, ra);   // call the program


 (As the uninits do not run, it is somehow as if the program is regarded to
 not have ended.)

 ---rony



 On Sun, Jun 14, 2009 at 5:58 AM, Rony G.
 Flatscherrony.flatsc...@wu-wien.ac.at wrote:


 Currently, the BSF4Rexx.dll works as intended, if Rexx scripts are
 started via rexx.exe, and the dll is loaded via rexx.exe. The loader
 function runs when BSF4Rexx gets loaded, the uninits and the unloader
 function run, upon termination of the Rexx script.

 In use case # 2, Java loads BSF4Rexx.dll, creates an interpreter
 instance (which causes the loader function for BSF4Rexx to run) and
 executes Rexx scripts via that instance. When the interpreter instance
 terminates, no uninits nor the unloader function runs.

 So far, I have not been able to figure out why use case # 2 would
 exhibit this deviating behaviour. Just wanted to add the info that the
 uninits are not run either upon termination of that Rexx instance.

 Again, any ideas of what might cause this or what I may do to corner
 that problem are highly appreciated!

 ---rony



 --
 Crystal Reports - New Free Runtime and 30 Day Trial
 Check out the new simplified licensing option that enables unlimited
 royalty-free distribution of the report engine for externally facing
 server and web deployment.
 http://p.sf.net/sfu/businessobjects
 ___
 Oorexx-devel mailing list
 Oorexx-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/oorexx-devel



--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Uninits not running

2009-06-14 Thread Rony G. Flatscher
Rick McGuire wrote:
 All of the symptoms you describe would suggest you are not terminating
 your interpreter instances correctly...but that's what I suggested
 earlier...
   
Yes. Because of that I made sure (and will make sure with the planned
nutshell example) that Terminate() is invoked in the same thread that
created the Rexx interpreter instance, but this did not change the
observed behaviour.

An example which requires BSF.CLS (which requires BSF4Rexx.dll):

say hello world.
::requires BSF.CLS
  

where BSF.CLS has a directive

::requires BSF4Rexx library

If rexx.exe runs this script, then the loader and the unloader runs, and
the uninits of those supporting Rexx objects that get created in BSF.CLS
(using the external functions of BSF4Rexx.dll).

If this script is run via Java/JNI, then the loader runs, but no uninits
nor the unloader function. It is made sure that the Terminate() is
issued in the same thread that created the Rexx interpreter instance to
terminate.

To the best of my knowledge no other Rexx threads run for that Rexx
interpreter instance, which is the only instance that gets created by
the application.

---rony


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel