[erlang-questions] Questions about PID of remote process
Nicolas Charpentier
nicolas.charpentier@REDACTED
Thu May 13 09:54:54 CEST 2010
Hi,
On 13 May 2010, at 06:09, 钱晓明 wrote:
> Hi, I have two questions about pid of remote process:
>
> 2. Can the PID be reused in one node? If a process identified by one PID
> died, then this PID can be used to identify other process created later?
>
PIDs are unique for all the life of one node, but if the node is restarted 'almost' the same pid will be used.
The difference will be the node incarnation number.
This value is not visible when you print the value of PID. So if you store a PID in a database with
pid_to_list(PID) and retrieve it later with list_to_pid(List), you may send a message to the wrong process if the node on which the process was running crashed.
Regards,
Nicolas Charpentier
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
More information about the erlang-questions
mailing list