Hi!<div><br></div><div>You are always starting a new erlang node when you start an erlang shell. What the -sname parameter does is to also enable distributed erlang on the node as part of the startup process. You can get the same effect by running net_kernel:start([bar, shortnames]). and net_kernel:start([foo, shortnames]). in the shells of two unnamed node (shells as you called them).</div>
<div><br></div><div>You can verify that two unnamed erlang nodes are indeed two separate (OS) processes running independently by starting two using "erl" and searching for beam.smp in a process list viewer of your choosing.</div>
<div><br></div><div>/ Magnus<br><br><div class="gmail_quote">On Tue, Nov 15, 2011 at 3:45 AM, Barco You <span dir="ltr"><<a href="mailto:barcojie@gmail.com">barcojie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear Erlangers,<div><br></div><div><br></div><div>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.</div>
<div><br></div><div>However, we can still send messages between shells on the same machine by starting them as nodes:</div><div>>erl -sname bar -setcookie barco >erl -sname foo -setcookie barco</div>
<div><div>Eshell V5.8.4 (abort with ^G) Eshell V5.8.4 (abort with ^G)</div></div><div><div>(bar@youjie-nb)5> register(bar,self()). (foo@youjie-nb)1> {'bar@youjie-nb',bar} ! "hello bar!".</div>
<div>true "hello bar!"</div><div>(bar@youjie-nb)6> flush().</div><div><div>Shell got "hello bar!"</div><div>
ok</div></div></div><div><br></div><div>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?</div>
<div><br></div><div>Any insight would be appreciated.</div><div><br></div><div><br></div><div>Best regards,</div><div>Barco</div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>