Group Abstract Group Abstract

Message Boards Message Boards

How do parallel kernel JLink object methods execute?

Posted 6 years ago
POSTED BY: David Gathercole
2 Replies
Anonymous User
Anonymous User
Posted 6 years ago

I suggest "working with Mathematica not against it". You can run multiple kernels so do not launch your JLink app from a front end notebook that is expecting a return (so to show the Output). You can use another kernel + another front end (still hanging a front-end just not your active one). Or you can run in parallel using the front end's parallel command to begin (not one inside or began by JLink).

in other words I suggest trying to use this as preferred:

Help: guide/LowLevelInterfaceControl

(you are trying to trick the front end not to wait for what it is supposed to wait for may not be the best plan. and also the parallel command your using isn't the normal parallel run command it's for JLink and is special. perhaps you could wrap that parallel command in a parallel command - but i wouldn't bother trying, because there is more to consider that is going on)

I can't see how it would ever work. You are trying to "take over the mouse" without "being connected" to the front end - likely making the mouse move via OS/Java not by Mathematica built-in commands. The front-end has no idea whether it would or wouldn't wait: it is getting OS messages "mouse clicked" or waiting on pending ones using something like "polling" to wait.

Your using code (seen above) that expects a notebook (to print timing) so you can expect it might stay connected to the FrontEnd to wait for the Output. You executed no code in JLink to disconnect from the front-end (to change where Output goes - which is a mathematica feature you can try). Java isn't going to disconnect from a front-end it's using the mouse of - it wouldn't know how.

You can start a binary (say, /bin/ls) using Parallel within mathematica and not wait for output. I've done that it works fine. So it's not an issue that mathematica front-end always waits for output despite parallel being used. the parallel built-ins work fine.

You may not want to use Java JLink if you need access to mathematica's view of the Mouse because Java's mouse is likely connected (talking to) the OS - unless you invoke Mathematica's mouse functions from JLink which is kinda a 360 but might work (i doubt it, that's "asking for too much").

hope that helps

POSTED BY: Anonymous User
POSTED BY: David Gathercole
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard