<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi,<br>
    <br>
    First of all, if you want to send messages using pid's, there are
    few things to consider:<br>
    1. you can use either pid(0,32,0) or list_to_pid([0,32,0]);<br>
    2. you can use register to give human label to your process;<br>
    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.<br>
    <br>
    <br>
    <br>
    On 11/15/2011 03:45 AM, Barco You wrote:
    <blockquote
cite="mid:CA+qFv3ufvD214Hc8sfdBj32jYqEbFWZd4BWe06Z9FyTgxucvag@mail.gmail.com"
      type="cite">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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>