Can you link two processes in Erlang if the current process is not one?

Erlang can be called link(pid)to associate the current executable process with the process identified pid. Is it possible to associate a process with another if it is not currently running?

+4
source share
2 answers

No, you can’t.

You can only link/ unlinkfrom the current process to another. If the other process is inactive, you will receive an error noproc(if you catch the outputs) or get an exit signal (if you do not catch the outputs or another process is on another node).

You can also use spawn_linkto create and link in one atomic operation.

+3
-1

Source: https://habr.com/ru/post/1608418/


All Articles