Can someone explain the structure of a Pid (Process Identifier) in Erlang?

后端 未结 5 1964
走了就别回头了
走了就别回头了 2020-11-28 02:40

Can someone explain the structure of a Pid in Erlang?

Pids looks like this : , e.g. <0.30.0> , but i would like to kno

5条回答
  •  借酒劲吻你
    2020-11-28 03:32

    Process id < A.B.C > is composed of:

    • A, node id which is not arbitrary but the internal index for that node in dist_entry. (It is actually the atom slot integer for the node name.)
    • B, process index which refers to the internal index in the proctab, (0 -> MAXPROCS).
    • C, Serial which increases every time MAXPROCS has been reached.

    The creation tag of 2 bits is not displayed in the pid but is used internally and increases every time the node restarts.

提交回复
热议问题