[erlang-questions] [Code Review] Is this a good idea? I linking 3 process manually (not using recursive)
I Gusti Ngurah Oka Prinarjaya
Fri Mar 8 11:58:09 CET 2019
I need your help to review my code. I create and linking 3 process manually
without using recursive. And inside p1 and p2 i using IF statement to check
to make sure spawning process will only once.
I mean, is part code below is a good idea?
1. IsPidExists = whereis(xxx),
2. if IsPidExists =:= undefined ->
3. Pid = spawn_link(?MODULE, the_p, ),
4. register(xxx, Pid);
5. true -> true
This is my code https://pastebin.com/3MXcUNUp
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions