Hi Bruce,

While studying a phenomenon with loading the JVM via rexx I stumbled
over a MacOSX-Cocoa-specific problem. Studying the background of this
problem yields the following situation: the main (first) thread must
create a CFRunLoop, if GUI-related event handlers are to be used. For
that reason, the JVM should be loaded in a separate thread such that if
awt is being used the necessary interaction with the event loop can be
established successfully.

Here an example
<http://www.kxcad.net/cae_MATLAB/toolbox/compiler/f2-1010645.html> how
one could initialize a shared library on a separate thread, such that
the main thread can create and dispatch the CFRunLoop.

Now the problem: the executable rexx and rexxc seem not to be aware of
this particular MacOSX demand. As a result, if a Rexx script was invoked
via the executable rexx and needs to load the JVM via BSF4ooRexx, then
this would not work, if using awt (abstract window toolkit, the basic
Java GUI classes, creating among other things the awt event thread) as
rexx/rexxc would not create a CFRunLoop on the main-thread it seems (no
awt event dispatching takes place, it is as if the awt event thread is
not receiving any events).

A solution - that demanded MacOSX expertise or at least "know-how" I am
missing - would be, if the rexx/rexxc executables on MacOSX were able to
create such a CFRunLoop, such that a JVM loaded on a separate thread can
interface with it. (It seems that Apple has an "enveolope" technique to
invoke console apps and GUI apps alike with an event based invocation,
judging from a book "Cocoa Programming - A Quick-Start Guide for
Developers" by Daniel H. Steinberg. But not sure about the standard
files stdin, stdout, stderr and the like, hence the need for a true Mac
expert.)

Would it be possible, feasible for you to create such a MacOSX
rexx/rexxc starter that was able to dispatch console and GUI Rexx
programs alike? Maybe running the supplied Rexx script on another thread
and waiting until that thread ends and then leaving the CFRunLoop, or
something like that ?

Regards,

---rony


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to