Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Printed process ids &lt; A.B.C > are composed of <a href="http://github.com/mfoemmel/erlang-otp/blob/R13B/erts/emulator/beam/erl_term.h#L502" rel="noreferrer">6</a>:</p> <ul> <li>A, the node number (0 is the local node, an arbitrary number for a remote node) </li> <li>B, the first 15 bits of the process number (an index into the process table) <a href="http://github.com/mfoemmel/erlang-otp/blob/R13B/erts/emulator/beam/erl_term.h#L534" rel="noreferrer">7</a></li> <li>C, bits 16-18 of the process number (the same process number as B) <a href="http://github.com/mfoemmel/erlang-otp/blob/R13B/erts/emulator/beam/erl_term.h#L534" rel="noreferrer">7</a></li> </ul> <p>Internally, the process number is 28 bits wide on the 32 bit emulator. The odd definition of B and C comes from R9B and earlier versions of Erlang in which B was a 15bit process ID and C was a wrap counter incremented when the max process ID was reached and lower IDs were reused.</p> <p>In the erlang distribution PIDs are a little larger as they include the node atom as well as the other information. (<a href="http://erlang.org/doc/apps/erts/erl_ext_dist.html#8.8" rel="noreferrer">Distributed PID format</a>)</p> <p>When an internal PID is sent from one node to the other, it's automatically converted to the external/distributed PID form, so what might be <code>&lt;0.10.0&gt;</code> (<code>inet_db</code>) on one node might end up as <code>&lt;2265.10.0&gt;</code> when sent to another node. You can just send to these PIDs as normal.</p> <pre><code>% get the PID of the user server on OtherNode RemoteUser = rpc:call(OtherNode, erlang,whereis,[user]), true = is_pid(RemoteUser), % send message to remote PID RemoteUser ! ignore_this, % print "Hello from &lt;nodename&gt;\n" on the remote node's console. io:format(RemoteUser, "Hello from ~p~n", [node()]). </code></pre> <p>For more information see: <a href="http://github.com/mfoemmel/erlang-otp/tree/5b6dd0e84cf0f1dc19ddd05f86cf04b2695d8a9e/erts/emulator/beam/erl_term.h#L498" rel="noreferrer">Internal PID structure</a>, <a href="http://github.com/mfoemmel/erlang-otp/tree/5b6dd0e84cf0f1dc19ddd05f86cf04b2695d8a9e/erts/emulator/beam/erl_node_container_utils.h#L24" rel="noreferrer">Node creation information</a>, <a href="http://erlang.2086793.n4.nabble.com/PID-recycling-td2108252.html#a2108255" rel="noreferrer">Node creation counter interaction with EPMD</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload