English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang 二进制 is_pid 方法

Erlang 进程

此方法用于确定进程ID是否存在。

语法

Is_pid(processid)

参数

  • processid −这是进程ID,需要检查是否存在。

返回值

如果进程ID存在,则返回true,否则将返回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",[is_pid(Pid)]).

输出结果

当我们运行上面的程序时,我们将得到以下结果。

true"hello" "process"

Erlang 进程