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

Re: [Factor-talk] Multithreading in Factor

2014-11-21 Thread Andrea Ferretti
I think the missing point for me was . I knew how to start a few server examples, but in general 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 (for instance I had no idea w

Re: [Factor-talk] Multithreading in Factor

2014-11-20 Thread Jon Harper
Just to confirm that the following sequence of actions work (ie print "hello" in the first factor instance) $ ./factor # first factor process USING: concurrency.distributed threads io.sockets io.servers ; "127.0.0.1" 9000 start-server FROM: concurrency.messaging => receive ; : log-message ( --

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 wrote: > Thank you for you response. Regarding the possibility if delegating > CPU inte

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 Chris Double
On Thu, Nov 20, 2014 at 8:24 AM, Andrea Ferretti 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 examples of current usage

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 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: On Sun, Oct 19, 2014 at 4:30 AM, Andrea Ferretti

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-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=threading&group=comp.lang.factor.general&sort=relevance). 2014-10-13 18:14 GMT+02:0

[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 an

Re: [Factor-talk] Multithreading

2014-06-19 Thread Jon Harper
Hi Andrea, On Thu, Jun 19, 2014 at 12:46 PM, Andrea Ferretti wrote: > > Am I right in understanding that futures actually do run in a > different OS thread that shares nothing with the creating thread? No, futures also use coroutines in the same OS thread. You need multiple factor processes to

[Factor-talk] Multithreading

2014-06-19 Thread Andrea Ferretti
Hi all, I am new to Factor and I am just starting to dablle with it. I have to say that I am impressed that such a small community created a programming language this mature and all the libraries that surround it. I am trying to figure out the current situtation about multithreading. On the one h