[erlang-questions] The most efficient way to make sure a remote process is alive

Logan, Martin MARTIN.LOGAN@REDACTED
Fri Jul 30 00:11:41 CEST 2010


Agreed on that count but I don't have that option.  is_process_alive is nice but only for local processes. I was thinking the function would use that first to determine if the process is alive and local, if that fails then some more time consuming check would be needed.  I can use node/1 to figure out what node it is on and then check to see if that node is within nodes() and if it is not, then I know the process is dead.  Provided that all those checks pass though then what am I left with - needing to do an rpc call on is_process_alive?  Any clever ideas, some interface I don't know of?


On 7/29/10 11:46 AM, "Paul Fisher" <pfisher@REDACTED> wrote:

The best way i have found is to create a relay process locally, that monitors the remote one, forwards messages, and exits on DOWN.   Then u can use erlang:is_process_alive/1 on the local one.  Still a race when it is dying, but that is there for local processes too.

On Jul 29, 2010, at 11:22 AM, Logan, Martin wrote:

> I am looking for the absolute most efficient way to make sure a process, referenced by a pid I have, is alive. The process my pid references could of course be local or remote. There are lots of ways but I want the most efficient and I can't assume any application level code - this must be generic. Thoughts?
>
> Cheers,
> Martin

--
paul




More information about the erlang-questions mailing list