Jan Jacobs asked:
> is it possible for a master J-session to initiate other J-sessions that run
> on separate cores
Sure. For example, the follow lines will execute a fresh J session:
require 'task'
fork BINPATH_z_, PATHSEP_j_ (, }.~ [ i:~ ,) >{.ARGV_z_
Of course it's up to the OS to assign tasks to cores appropriately (which OSes
are pretty good at).
In terms of having these new tasks do something useful, the simplest way is to
keep them independent (ie. no sharing of data), and
simply control their execution through extra command line parameters.
If you must share data, or even pass messages, then you're pursuing coarse
parallelism, which has been discussed in some depth
recently. For example, see this thread:
http://www.jsoftware.com/pipermail/chat/2010-February/003190.html
(which references a number of previous threads on the same or related topics.)
That thread resulted in a Wiki initiative to
implement a (user-level, coarse) parallelism utility in J. Don has started
collecting ideas for that implementation on the Wiki:
http://www.jsoftware.com/jwiki/MultiCoreSupport
Since it's a favorite of Devon's, we also discuss this topic frequently in the
NYC JUG, so you might try searching the minutes of
our meetings on the Wiki as well (I mean visually -- a lot of our notes are
scanned in as images, rather than being transcribed as
text).
But in short, at the moment there's nothing off-the-shelf to help distribute J
workload. If you have an immediate need, you'll have
to roll something of your own. Shared mapped files (for large data) and
sockets (for asynchronous alerts or messages) provide good
starting points. There may be some examples or demonstrations of this in the
Forum archives, if you dig a little.
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm