[erlang-questions] Access to process dictionary
Loïc Hoguin
essen@REDACTED
Sun Dec 23 11:51:50 CET 2018
It's you. :-)
On 23/12/2018 11:15, Pierre Fenoll wrote:
> Hi list.
> Am I the only one not seeing the first email of most threads? Or is it
> my gmail mobile client that does its thing?
> Thanks & be well
>
> On Sun 23 Dec 2018 at 10:13, Eric Pailleau <eric.pailleau@REDACTED
> <mailto:eric.pailleau@REDACTED>> wrote:
>
> 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 <mailto:erlang-questions@REDACTED>
>>
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions
>
> --
>
> Cheers,
> --
> Pierre Fenoll
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
--
Loïc Hoguin
https://ninenines.eu
More information about the erlang-questions
mailing list