[erlang-questions] What's the difference between starting erlang vms (pure erl shell) and starting erlang nodes on the same machine?

Barco You barcojie@REDACTED
Tue Nov 15 04:32:45 CET 2011


Hi CGS,

1 and 2 seems not to answer my question. Regarding 3, that's my question:
we can send messages between nodes, but how can we do it if two shells are
not started as nodes.


Regards,
Barco

On Tue, Nov 15, 2011 at 11:12 AM, CGS <cgsmcmlxxv@REDACTED> wrote:

> **
> Hi,
>
> First of all, if you want to send messages using pid's, there are few
> things to consider:
> 1. you can use either pid(0,32,0) or list_to_pid([0,32,0]);
> 2. you can use register to give human label to your process;
> 3. as far as I know, you cannot send messages using only the pid's if the
> processes are in different shells, you can use {Name,Node} or send/2,3.
>
>
>
>
> On 11/15/2011 03:45 AM, Barco You wrote:
>
> Dear Erlangers,
>
>
>  When I start two erl shells on the same machine, I got one shell with
> pid <0.30.0> and the other one with <0.32.0>, and if I send a message on
> the first shell:" list_to_pid("<0.32.0>") ! hello.", the second shell got
> nothing by calling "flush()" on it.
>
>  However, we can still send messages between shells on the same machine
> by starting them as nodes:
> >erl -sname bar -setcookie barco
>          >erl -sname foo -setcookie barco
>  Eshell V5.8.4  (abort with ^G)
>               Eshell V5.8.4  (abort with ^G)
>  (bar@REDACTED)5> register(bar,self()).
>              (foo@REDACTED)1> {'bar@REDACTED',bar} ! "hello bar!".
> true
>                        "hello bar!"
> (bar@REDACTED)6> flush().
>  Shell got "hello bar!"
>  ok
>
>  I hope to know the difference between the twos ways of starting erlang
> shell. Can two shells (not as nodes) send each other messages? Will the two
> erlang VMs (I assume one VM for one shell) share the same
> schedulers/run-queues on every core or each one has its own
> schedulers/run-queues on every core? and what about the VMs for nodes?
>
>  Any insight would be appreciated.
>
>
>  Best regards,
> Barco
>
>
> _______________________________________________
> erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111115/8b46daca/attachment.htm>


More information about the erlang-questions mailing list