When to use OTP vs 'bare' processes?

I like the Registry’s option of process access using :via (provided the messaging isn’t too chatty) and having separate registries for each subsystem.

That seems like trying to solve the wrong problem…

If you don’t want named process then just start a supervised GenServer and start a linked Supervisor from it? Am I missing something important here?

Edit: I think the only thing you would need to make sure of is a shutdown strategy. You would need the GenServer to exit after the child supervisor does.

Ancestors are recursive parents, with the head being a direct parent. The parent is the process which invoked a proc_lib function to start the process. All variants of proc_lib starter functions (such as start_link, spawn_link) will run the process inside proc_lib:init_p, which sets the ancestors procdict flag. See here and here.

Not sure what you mean by “extra pid”. If you import a script, the script is evaluated, which (I presume without trying it out) happens inside the shell process. Therefore, if from a script you start_link a process (let’s call it foo), per what I said above, its parent will be the shell process. If foo starts its own child (let’s call it bar), then ancestors of bar are foo and the shell process.

Indeed, you are right. I wonder why I got so confused about.

Maybe it was just because none of the gen processes look up the pdict, they keep track of their parents in their loops.

Maybe I just thought there was some grander purpose and the pdict lookup wasn’t always reliable.