[erlang-questions] Process Dictionary limitations??

Richard O'Keefe <>
Fri Oct 12 09:28:18 CEST 2012


On 12/10/2012, at 4:35 AM, Charles Hixson wrote:
> 
>> 
> I thought process dictionaries were "per process".

They are.

>  If so, and I don't export the values (which I don't intend to), then how would any other part even have access to them?

I'm not sure what you mean by ``export''.
process_info(Pid, dictionary) will let you read the process dictionary
of another process.  This is of course meant as a debugging tool, and
if it bothers you,
process_flag(sensitive, true)
will let you say ``this process's dictionary is NOT to be revealed.''

The transformation I sketched didn't allow for debugging tools.

> 
> What these would be used for is things like adjusting the weight of a weighted graph cell, or deciding that a cell was too inactive, and should be rolled out.  (I haven't worked out just how to do that, wanting to decide first if I should learn Erlang, or look for another language that could do what I need.)  In analogy to C, they would be the equivalent of a static local variable.  Or perhaps a C++ class private variable is closer.

Since static local variables and class private variables are per-program,
not per-process, neither would seem to be a good analogue.

I get this uneasy feeling that you are letting language features drive
design.  



More information about the erlang-questions mailing list