[erlang-questions] Access to process dictionary
Eric Pailleau
eric.pailleau@REDACTED
Sun Dec 23 10:13:02 CET 2018
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.
Regards
Envoyé depuis mon mobile
---- Donald Steven a écrit ----
>Merci Eric!
>
>On 12/22/2018 8.56 AM, Eric Pailleau wrote:
>
>Hi,
>
>Process dictionary is a dictionary for a process.
>
>If you call each functions from different processes, they are independents.
>
>From a single process two functions cannot be called at same time.
>
>
>Envoyé depuis mon mobile
>
>
>
>---- Donald Steven a écrit ----
>
>Do two function calls with the same name but one parameter different
>
>(see below) share access to the same process dictionary or does each
>
>have a distinct instance?
>
>
>
>
>
>Example:
>
>
>
>
>
>funA(param1, param2) -> do something.
>
>
>
>funA(param1, differentparam2) -> do something different.
>
>
>
>
>
>===
>
>
>
>
>
>I could just use an if statement within one function call, but I'd like
>
>to know if they share the same process dictionary. Thanks.
>
>
>
>_______________________________________________
>
>erlang-questions mailing list
>
>erlang-questions@REDACTED
>
>http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181223/5872d336/attachment.htm>
More information about the erlang-questions
mailing list