Dear Moritz:
On 07.08.2017 15:02, Moritz Hoffmann wrote:
> without going into too much detail I would say it's hard to track down the
> root cause just from
> the stack traces. It still looks like a memory corruption issue that you're
> facing, especially
> because it's not a deterministic failure.
Yes, it definitely looks like it!
:(
> I don't see why you want to call into Rexx from different Java threads. Rexx
> has a global
> interpreter lock so you won't benefit from parallelism unless you have fully
> independent Rexx
> instances.
The reason is simple: when employing a Java GUI, then it should be possible to
write event handlers
in Rexx and to interact with the GUI objects from Rexx.
If an event is fired by Java, it will be fired on the GUI thread such that the
Rexx code is able to
directly interact with the GUI objects.
If a Rexx programmer needs to interact with GUI objects from a non-GUI thread,
then this would hang
the GUI. Rather, one needs to make sure that the Rexx interaction gets carried
out on the GUI thread
sometimes later. This is possible by invoking Platfrom.runLater() (in JavaFX,
cf.
<https://docs.oracle.com/javase/8/javafx/api/javafx/application/Platform.html>)
or
SwingUtilities.invokeLater (in Java swing, the predecessor of JavaFX, cf.
<https://docs.oracle.com/javase/8/docs/api/javax/swing/SwingUtilities.html#invokeLater-java.lang.Runnable->).
It is in this scenario, executing Rexx code on the JavaFX GUI thread that leads
to the reported and
observed crashes.
BSF4ooRexx has been quite stable for a long time including using it on multiple
threads in parallel.
>
> Is the code available somewhere? Can you put it on Github or some other place
> so people can have a
> look? (You can also create private repos there)
Yes, I just prepared it, you (and everyone interested in taking a look) can
fetch it from my
Dropbox, which also contains a "readme.txt" file (also attached to this mail):
<https://www.dropbox.com/sh/xjnzwm6r0qnugzc/AACN67fJc4CZ2NOYxNaSiewFa?dl=0>.
You would need (preferably 32-bit on Windows, because that is the ooRexx
version that is needed if
interfacing with MS Office):
* ooRexx 5.0beta (latest installation builds from trunk:
<https://www.dropbox.com/sh/x2dczehvq5fzqtx/AAA2U2G10ELtuvmtQZNPkw3pa?dl=0>
* Java (64- and 32-bit can be installed in parallel):
<https://java.com/en/download/manual.jsp>
* the latest BSF4ooRexx:
<https://sourceforge.net/projects/bsf4oorexx/files/beta/20161026/>.
You start the application by double-clicking "startTestProgressBar.rex" or
entering
"startTestProgressBar.rex" in a new command line window (such that the
installation changes to the
environment are honored).
If there are any questions that I can answer, I am more than willing to try!
;)
---rony
P.S.: "worker.rex" in this application uses a new ooRexx class named
"FxGUIThread" (defined at the
end of "BSF.CLS") to send Rexx messages to Rexx objects (including the GUI
proxy objects) sometimes
later on the JavaFX GUI thread.
purpose: Demo application for using JavaFX as GUI
this URL:
<https://www.dropbox.com/sh/xjnzwm6r0qnugzc/AACN67fJc4CZ2NOYxNaSiewFa?dl=0>
problem: Running the application after pressing the "Start" button will
eventually crash ooRexx
---
Assuming running on Windows 32-bit (32-bit mode allows ooRexx to interface with
MS Office which usually is 32-bit)
versions: - 32-bit 5.0beta ooRexx, e.g.
<https://www.dropbox.com/sh/x2dczehvq5fzqtx/AAA2U2G10ELtuvmtQZNPkw3pa?dl=0>
- 32-bit Java from Oracle:
<https://java.com/en/download/manual.jsp>, choose "Windows Offline" (as
opposed to "Windows Offline
(64-Bit)"); note, both, 32- and 64-bit
versions of Java may be installed at
the same time!
- latest BSF4ooRexx package from
<https://sourceforge.net/projects/bsf4oorexx/files/beta/20161026/>,
as of the writing this is its name:
<BSF4ooRexx_install_v600-20170807-beta.zip>.
- download and unzip the archive
- switch into folder "bsf4oorexx\install\windows",
run/double-click "install.cmd"
- this will copy BSF4ooRexx into
"%ProgramFiles(x86)%" (32-bit) or into "%ProgramFiles%" (64-bit)
and run the installer from there
- open a new command line window to have the new environment
available and run the application in
this directory (alternatively, double click the file via
Explorer):
startTestProgressBar.rex
---------------------------------------------------------------------------------------------------
The "startTestProgressBar.rex" application consists of the following files:
- startTestProgressBar.rex ..... main program that will load JavaFX and
wait until the user ends the program
- testProgressBar.fxml ......... the XML file containing the GUI
definitions allowing "rexx" to be used as
a scripting language; the Java
FXMLLoader will run the Rexx programs
"put_FXID_objects_into.my.app.rex" and
"testProgressBarController.rex";
this file was created with the Java
tool "SceneBuilder" (cf.
http://gluonhq.com/products/scene-builder/) and can be edited with it
- put_FXID_objects_into.my.app.rex ... this will "harvest" all JavaFX
objects and save them into the ooRexx
.environment under the entry "MY.APP"
(a directory) with the entry
"TESTPROGRESSBAR.FXML" (a directory)
which stores each JavaFX object
having a fx:id defined using that
value as the key into the directory
- testProgressBarController.rex ... this will define the event handlers
written in Rexx that are fired
by JavaFX when a button gets pressed;
the "Start" button will cause
the class method "startLongWork" of
the Rexx class "workerClz" to run;
it defines an entry "status" in
.my.app to communicate with the worker
methods in "worker.rex"
- worker.rex ................... defines the Rexx class "workerClz",
which defines the class methods
"startLongWork" and "updateGUI"
The application demonstrates how one can use a JavaFX GUI with a ProgressBar
from Rexx.
---------------------------------------------------------------------------------------------------
In case you wish to use a debug version of BSF4ooRexx as well, the precompiled
32- and 64-bit debug versions for
Windows are available together with the source in "dbg.bsf4oorexx.zip" (also
Makefiles for all platforms).
2017-08-07l, rgf
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel