[erlang-questions] starting multiple erlang nodes with a single command

Jon Meredith jon@REDACTED
Fri May 7 18:33:13 CEST 2010


Have you looked at the slave() module?

If you're using X11 you might be able to do something like this from 
inside erlang

start_displays() ->
   {ok, D1} = slave:start(net_adm:localhost(), display1, " -env DISPLAY 
" ++ net_adm:localhost() ++ ":1 "),
   {ok, D2} = slave:start(net_adm:localhost(), display2, " -env DISPLAY 
" ++ net_adm:localhost() ++ ":2 "),
   {D1, D2}.

You'll need to start erlang as a named node (erl -name master), then you 
should be able to access them using the node names in the return tuple. 
Then just use rpc:call to start up whatever you need (or tweak the 
startup args if you prefer).

Jon.

On 5/7/10 9:43 AM, kid_a wrote:
> Hello there,
>
> think it it my first post on this mailing list. :)
>
> I'm working on rosen [1], a robotic simulation engine that makes use of
> openGL, sdl [2] and its erlang bindings [3] in order to provide a
> graphical representation of the simulated environment.
> What I'm trying to do is to add support for stereoscopic vision,
> providing rosen with the ability to display two windows, each displaying
> the environment from a certain point of view.
>
> Unfortunately, the latest stable version of sdl (1.2.14) does not
> support multi-windowed application. So, to avoid the single-window
> limit, I thought about the following trick: to move the "graphical
> engine" of rosen on two different erlang nodes. It seems to work.
>
> So far, I've been forced to manually launch the nodes to have the
> application up and running, while I'd like to launch the entire system
> with a single command - e.g. using a Makefile. Is there a way to do so?
>
> Any other ideas/advices/suggestions? :)
>
> Loris
>
> [1] http://sourceforge.net/projects/rosen/
> [2] http://www.libsdl.org/
> [3] http://esdl.sourceforge.net/
>    



More information about the erlang-questions mailing list