Both functions start new instances of gen_server as children of the calling process, but they differ in that gen_server:start_link/3,4 atomically starts the child of gen_server and the link is its parent process. Linking means that if a child dies, the parent also dies by default. Supervisors are parent processes that use links to take action when their child processes fail, usually reloading them.
In addition to the connection associated with the gen_server:start_link , there are no multiprocessing aspects in these calls. Regardless of whether you gen_server:start or gen_server:start_link to start the new gen_server , the new process has one message queue and it receives and processes these messages one at a time. Nothing happens in gen_server:start_link , which leads to the fact that the new gen_server process behaves or works differently than if it started with gen_server:start .
source share