I was playing with the process dictionary inside a gen_server module, i called get() function and i get something like this.
{'$ancestors',[main_server,<0.30.0>]},
{'$initial_call',{child_server,init,1}}]
what happen if i erased the process dictionary, what would go wrong ?
i erased it and every thing worked fine, even
calling a function that generates an exception in the child_server the main_server still can get the exit signal.
$ancestors
is used only in the initialization stage, to get the parent's PID, which is used to catch theEXIT
message coming from the parent, so that theterminate
stuff can get executed. Erasing this key when the server is up and running makes no difference.$initial_call
, on the other hand, is used in the crash report byproc_lib
to dump the MFA info.A quick
grep
in the OTP source tree can certainly help.