This is called as is_process_alive(Pid). A Pid must refer to a process at the local node. It returns true if the process exists and is alive i.e., whether it is not exiting and has not exited. Otherwise, returns false.
processid − This is the process id which needs to be checked if it exists.
Returns true − If the process id exists else it will return false.
-module(helloworld). -export([start/0, call/2]). call(Arg1, Arg2) -> io:format("~p ~p~n", [Arg1, Arg2]). start() -> Pid = spawn(?MODULE, call, ["hello", "process"]), io:fwrite("~p~n",[is_process_alive(Pid)]).
When we run the above program we will get the following result.
true "hello" "process"