How are PIDs generated?

What the fields in a pid mean is an internal an implementation detail and it is upto the implementation to decide and interpret their meaning. For the sake of compatibility there will always be 3 fields. The only thing you can more or less with certainty get out of pid is the meaning of the first field, if it is 0 it is the pid of a local process otherwise it is a process on another node. There is no way to work out on which node by the value of the first field, except for 0. The only real way to get the node is to use node(pid).

You have the same issue with references and ports as well.

13 Likes