[erlang-questions] Ideas for a new Erlang
Thu Jun 26 19:52:46 CEST 2008
2008/6/26 Darren New <>:
> Ulf Wiger wrote:
>> I think we can stipulate that when serializing a pid, perhaps storing it
>> on disk, then re-creating it and trying to use it, all bets are off
> I would certainly hope not. One has to serialize a pid to send it to a
> different node. I would hope that creating a process on my node and then
> sending you the only copy of the pid returned by spawn() doesn't cause the
> process to exit if it's waiting for your node to send it a message.
In that case, the remote holder of the pid cannot rely on the pid referring
to the same process if it's used some time later. It should monitor the
process in order to detect whether it dies.
The process doesn't exit just because there are no known references
to it, but once a process /has/ died, and all known (local) references are
gone, some other process may reuse that pid. This is why storing pids
persistently is a very bad idea.
More information about the erlang-questions