Re: [Factor-talk] Multithreading in Factor

2014-11-21 Thread Andrea Ferretti
I think the missing point for me was node-server. I knew how to start a few server examples, but in general threaded-server requires an encoding and a few parameters for configuration. What was not obvious for me was how to create a server that would work with Factor distributed message passing

Re: [Factor-talk] Multithreading in Factor

2014-11-21 Thread John Benediktsson
- is it possible to start the second Factor instance from the first one? I guess this is possible using run-detached, but maybe there is something Factor specific. Phil Dawes spent some time working on a patchset to allow starting multiple Factor VM's in their own threads. You can see a

Re: [Factor-talk] Multithreading in Factor

2014-11-20 Thread Chris Double
On Thu, Nov 20, 2014 at 8:24 AM, Andrea Ferretti ferrettiand...@gmail.com wrote: I am trying to make this work, but I have issues with the line myhost.com 9001 start-server Looks like the API for starting servers/nodes has changed quite a bit. If you look at the following file you'll see

Re: [Factor-talk] Multithreading in Factor

2014-11-20 Thread John Benediktsson
I wrote a few posts about servers, here is one simple echo server example: http://re-factor.blogspot.com/2012/08/echo-server.html Also, this is a telnet server implemented fairly simply: https://github.com/mrjbq7/re-factor/blob/master/telnet-server/telnet-server.factor On Thu, Nov 20,

Re: [Factor-talk] Multithreading in Factor

2014-11-20 Thread John D. Mitchell
If you're talking about use in a single master process + multiple threads than check out the LMAX disruptor approach for inter-thread communication. Cheers, John On Oct 18, 2014, at 08:30 , Andrea Ferretti ferrettiand...@gmail.com wrote: Thank you for you response. Regarding the possibility

Re: [Factor-talk] Multithreading in Factor

2014-11-19 Thread Andrea Ferretti
I am trying to make this work, but I have issues with the line myhost.com 9001 start-server in the documentation. start-server takes a threaded server as input, and this just does not run as is. I could try with a threaded server, but I am not sure how to configure it, and what encoding to use.

Re: [Factor-talk] Multithreading in Factor

2014-10-18 Thread Andrea Ferretti
Thank you for you response. Regarding the possibility if delegating CPU intensive tasks to multiple tasks: what about communication? Is there an idiomatic way to make processes communicate without blocking? There is ZeroMQ, but as far as I know it is blocking. It would be nice to develop something

Re: [Factor-talk] Multithreading in Factor

2014-10-18 Thread Chris Double
ZeroMQ has a non-blocking mode. You can get a file descriptor that can be passed to select/epoll/kqueue. Factor has its own channel and serialization system to. See: http://docs.factorcode.org/content/article-remote-channels,remote-channels.html On Sun, Oct 19, 2014 at 4:30 AM, Andrea Ferretti

Re: [Factor-talk] Multithreading in Factor

2014-10-15 Thread Björn Lindqvist
Hi Andrea, I'm not an expert, so take what's written below with a grain of salt. It mostly comes from what I've snapped up from varius places and reading the mailing list archive (eg http://search.gmane.org/?query=threadinggroup=comp.lang.factor.generalsort=relevance). 2014-10-13 18:14 GMT+02:00

[Factor-talk] Multithreading in Factor

2014-10-13 Thread Andrea Ferretti
Hi, I have read in various places, including this mailing list, that Factor does not currently have support for (preemptive, kernel-level) multithreading, and that adding support for that would require a great deal of changes, since the underlying VM and many core words are not thread-safe. Can