I am trying to understand how spawn / spawn_link interplays with iex.
spawn
process p runs:
c = spawn(f)
if c
dies while executing f
, nothing happens to p
spawn_link
process p runs:
c = spawn_link(f)
if c
dies while executing f
, p
dies too
iex behaviour
So now for the consuing part: iex is something like
loop {
spawn_and_block_on_root_shell();
}
so if I am running the above in iex, in the spawn_link
case, process p
dies, but then the ‘iex loop’ creates a new p_2
to replace it ?
Is the above correct ?