We can't always use Pids to communicate with processes because to use a Pid, process needs to be notified of it and store its value. So it is necessary to register a process. To register a process use register(Name, Pid) BIF, where Name is an atom and Pid is the process identifier. but for that we just need to know the process identifier. (After registering a process we can send messages on that process.)
Some other BIFs that are also directly related to process registration for ex: unregister(Pid) to unregister the Pid. registered() it returns a list of registered names. whereis(Alias) it returns the Pid associated with the Alias.
Liked By
Write Answer
How to register a process in Erlang?
Join MindStick Community
You have need login or register for voting of answers or question.
Tarun Kumar
07-Mar-2016We can't always use Pids to communicate with processes because to use a Pid, process needs to be notified of it and store its value. So it is necessary to register a process.
To register a process use register(Name, Pid) BIF, where Name is an atom and Pid is the process identifier. but for that we just need to know the process identifier.
(After registering a process we can send messages on that process.)
Some other BIFs that are also directly related to process registration for ex:
unregister(Pid) to unregister the Pid.
registered() it returns a list of registered names.
whereis(Alias) it returns the Pid associated with the Alias.