[erlang-questions] Access to process dictionary

Attila Rajmund Nohl attila.r.nohl@REDACTED
Sun Dec 23 22:50:11 CET 2018


Eric Pailleau <eric.pailleau@REDACTED> ezt írta (időpont: 2018. dec.
23., V, 10:13):
>
> You should however avoid to use process dictionaries if possible.
>
> It is handy to store things, but generally a sign that your code is missing something.
>
>
> For instance if you face some processes crashes, your process dictionary will be lost, while using states in OTP libs will be shown in crash report. Easier for debugging.

I do see the process dictionary in crash reports (I'm not sure if
lager puts it there or it is there by default). Process dictionary is
useful for read-only data (i.e. not state): put stuff there at process
startup, then don't have to worry about passing yet an other value
around, all function can access that piece of data.



More information about the erlang-questions mailing list