>
>
> - 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 test for it here:


https://github.com/slavapestov/factor/blob/master/extra/native-thread-test/native-thread-test.factor

I'm not sure if we merged all of his patches, but you can search his name
on the mailing list and there is a couple links on the issue I filed to
look into this:

    https://github.com/slavapestov/factor/issues/1161

I imagine you want to build something a bit like the Python multiprocessing
module.  It shouldn't be that hard to do, but might require building a few
things. The server framework is pretty flexible and well tested (
factorcode.org, for example, runs on a Factor http server).  We have
serialization code, a few examples of RPC, but you might have to put it all
together for your needs.  Would make a great contribution!  Concurrency is
one of priorities after releasing a small 0.97.1.

Best,
John.



>
> Just to clarify, my end goal would be to be able to launch a few
> worker processes, say a fixed multiple of the number of available
> cores, and have a Factor frontend that delegates work to them. Servers
> are becoming more and more multicore, and it is hard to sell Factor
> without being able to make good use of them.
>
>
> 2014-11-21 0:05 GMT+01:00 Jon Harper <jon.harpe...@gmail.com>:
> > 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 <inet4> <node-server> start-server
> > FROM: concurrency.messaging => receive ;
> > : log-message ( -- ) receive . flush log-message ;
> > [ log-message ] "logger" spawn dup name>> register-remote-thread
> >
> >
> > $ ./factor # second factor process
> > USING: io.sockets concurrency.messaging concurrency.distributed ;
> > FROM: concurrency.messaging => send ;
> > "hello" "127.0.0.1" 9000 <inet4> "logger" <remote-thread> send
> >
> > Jon
> >
> >
> > Jon
> >
> > On Thu, Nov 20, 2014 at 10:09 PM, Chris Double <
> chris.dou...@double.co.nz>
> > wrote:
> >>
> >> 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 examples of current
> >> usage:
> >>
> >> basis/concurrency/distributed/distributed-tests.factor
> >>
> >> --
> >> http://bluishcoder.co.nz
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> >> with Interactivity, Sharing, Native Excel Exports, App Integration &
> more
> >> Get technology previously reserved for billion-dollar corporations, FREE
> >>
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Factor-talk mailing list
> >> Factor-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> > with Interactivity, Sharing, Native Excel Exports, App Integration & more
> > Get technology previously reserved for billion-dollar corporations, FREE
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to