2006/12/25, Dan Bron <[EMAIL PROTECTED]>:
> Any example? How do I achieve concurrency(multi-threading) in J?
You can't.
The part, "in a separate thread or task" from User Manual read like I
can achieve some sort of concurrency. What does thread or task exactly
mean here?
You do have some options, though: You could write (e.g.) a VB application that
does GUI in one thread and interacts with J (via COM, DLL calls, etc) in
another. Or you could have several instances of J running, communicating
through sockets, (named) pipes, (mapped) files or a combination thereof.
If I were to do GUIs with J (I don't), I'd avoid wd altogether. If I didn't
have to create standalone executables for client machines, I'd use
XHTML+CSS+CGI; maybe Oleg's JHP. If I didn't have that option, I'd create a
GUI in C# and load J through COM.
Were I after parallelization of logic in J, I'd run several instances of
jconsole, which would raise events via sockets and pass data via mapped files.
Thank you for suggesting many options.
What, exactly, are your goals?
Suppose you wanted to add some feature to the plain Labs. While you
are on one section, you can see a progress bar proceeding with the
remaining time for the section constantly decreasing and finally
advancing to the next with some message when the time's up. You could
run J sentences in the ijx window and you don't want the progress bar
to be unresponsive.
I think using sys_timer could be a solution, like in javascript.
However, it may get quite complicated and keeping the windows
responsive is very hard.
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm