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

CGS <>
Tue Nov 15 04:12:10 CET 2011


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)
> ()5> register(bar,self()).                               
>                ()1> {'',bar} ! "hello bar!".
> true                                                                   
>                            "hello bar!"
> ()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 list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111115/aeb30293/attachment.html>


More information about the erlang-questions mailing list