Registered Processes
If we want to send a message to a process, then we need to know its PID, but when a process is created, only the parent process knows the PID. No other process in the system knows about the process. This is often inconvenient since the PID has to be sent to all processes in the system that want to communicate with this process. On the other hand, it’s very secure; if you don’t reveal the PID of a process, other processes can’t interact with it in any way.
Erlang has a method for publishing a process identifier so that any process in the system can communicate with this process. Such a process is called a registered process. There are four BIFs for managing registered processes.
register(AnAtom, Pid)-
Register the process ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access