On 10 July 2013 02:42, I.T. Daniher <[email protected]> wrote in thread "ymacs": > .... This is perhaps more a petition for better > threading / async support in J in general
As Raul said in the ymacs thread, concurrency (async) can be acheived using multiple processes [multiprocessing]. Trendy things like .NET and Java do multithreading. A language implementation that doesn't support multithreading is not necessarily deficient. For example, through the language 'k' (an APL inspired language), kdb+ has blown away competitors in a STAC M3 benchmark [focused on finance and automated trading] partially with a new multiprocessing feature, which performs better than multithreading in this context. Multiple processes can communicate using sockets (as Raul illustrated) Using sockets involves "message passing" which is a lot easier than using threads and locks. Erlang, a language built around concurrency, uses message passing. On 10 July 2013 02:42, I.T. Daniher <[email protected]> wrote: > Unfortunately, the collection of data isn't always a low-overhead task, so >... workflow consists of writing an experiment, running the script, and viewing > / processing the resulting data. > ... J IDEs to be ill suited to a more realtime/interactive paradigm due to UI > requests, and in some cases, interaction with the text editor window > itself, being blocked by "long-running" data collection. Here's a recipe for multiprocessing your example: - start a J process that listens for 'experiments' on socket with port 4321 - start the J IDE and send an experiment message (eg: send 'sin 0.2 * i.60') to port 4321. - continue to refine your experiment in the IDE - when the the result message arrives, the J IDE can pop up a plot. . In addition to Raul's pointers, this might be a good place to start: http://www.jsoftware.com/jwiki/Studio/Socket%20Driver Ta, Jack. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
