Process alive ?

Ulf Wiger etxuwig@REDACTED
Tue Dec 17 10:49:22 CET 2002


On Tue, 17 Dec 2002, Vladimir Sekissov wrote:

>Good day,
>
>You can use
>
>is_process_alive(Pid)
>
>or
>
>rpc:call(Node, erlang, is_process_alive, [Pid])
>
>if it is on another node.


Or, if you don't have a Pid,

 whereis(LogicalName)

assuming that the process has registered a logical name
using register(LogicalName, self()).

whereis/1 returns a pid or 'undefined'.

If you're checking from a remote node:

  rpc:call(Node, erlang, whereis, [LogicalName]).

You can also use erlang:monitor(process, PidOrName).
If the process is not alive, you will receive a 'DOWN'
message. This is what gen:call() does. It works also in a
distributed setting.


/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks




More information about the erlang-questions mailing list