<div dir="auto"><div>The same is true for e.g. public named ETS tables or even for modules. If a different library uses the same name, it's a problem.<br><br><div class="gmail_quote"><div dir="ltr">2018. dec. 24., Hét 0:10 dátummal Eric Pailleau <<a href="mailto:eric.pailleau@wanadoo.fr">eric.pailleau@wanadoo.fr</a>> ezt írta:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr" style="margin-top:0;margin-bottom:0">Hi, </p>
<p dir="ltr" style="margin-top:0;margin-bottom:0">Yes you are right. I forgot this. </p>
<p dir="ltr" style="margin-top:0;margin-bottom:0">Anyway process dictionary should be avoid because same dictionary entry name could be used in different library code called in same process. </p>
<p dir="ltr" style="margin-top:0;margin-bottom:0">Let say you create an entry 'foo' in your code, but you use external code having same idea. Your dictionary can be overwritten. It is not safe. </p>
<br>
<p dir="ltr" style="margin-top:0;margin-bottom:0">Envoyé depuis mon mobile </p><br><br>---- Attila Rajmund Nohl a écrit ----<br><br>Eric Pailleau <<a href="mailto:eric.pailleau@wanadoo.fr" target="_blank" rel="noreferrer">eric.pailleau@wanadoo.fr</a>> ezt írta (időpont: 2018. dec.<br>23., V, 10:13):<br>><br>> You should however avoid to use process dictionaries if possible.<br>><br>> It is handy to store things, but generally a sign that your code is missing something.<br>><br>><br>> 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.<br><br>I do see the process dictionary in crash reports (I'm not sure if<br>lager puts it there or it is there by default). Process dictionary is<br>useful for read-only data (i.e. not state): put stuff there at process<br>startup, then don't have to worry about passing yet an other value<br>around, all function can access that piece of data.<br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank" rel="noreferrer">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" rel="noreferrer">http://erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div></div></div>