這用于在系統(tǒng)中注銷(xiāo)進(jìn)程。
unregister(atom)
atom ?這是要賦予該過(guò)程的注冊(cè)名稱(chēng)。
None
-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)]),
unregister(myprocess),
io:fwrite("~p~n",[whereis(myprocess)]).當(dāng)我們運(yùn)行上面的程序時(shí),我們將得到以下結(jié)果。
<0.55.0> "hello" Undefined