English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
これは whereis (Name) と呼ばれています。名前で登録されたプロセスの pid を返します。
whereis(atom,pid)
アトム −これはそのプロセスに割り当てる登録名です。
アトムにバインドされたプロセスID。
-module(helloworld). -export([start/0, call/2]). call(Arg1, Arg2) -> io:fwrite("~p~n",[Arg1]). start() -> Pid = spawn(?MODULE, call, ["hello", "process"]), register(myprocess, Pid), io:fwrite("~p~n",[whereis(myprocess)]).
上記のプログラムを実行すると、以下のような結果が得られます。
<0.55.0> "hello"