[erlang-questions] Questions about PID of remote process

Bernard Duggan bernie@REDACTED
Thu May 13 07:17:20 CEST 2010


Hi 钱晓明,

On 13/05/10 15:09, 钱晓明 wrote:
> 1. How do I know if the remot process identified by one PID is alive? I
> know I can send a message to it, and receive response with timeout. But I
> hope there is some way more conveniently.
>   
One option (the one we use) is erlang:monitor(process, Pid). If he Pid
dies or the node goes down, or is down when you make the monitor() call
you'll get a message notifying you of the fact.
> 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?
>   
Not as far as I know - the fact that you can call node(Pid) to get the
node on which a PID resides, even after that PID has terminated, implies
that the PID embeds (or at least links to) unique node information.

Cheers,

Bernard


More information about the erlang-questions mailing list