[erlang-questions] Request for opinions on using process dictionary for meta information
Tue Apr 18 11:44:54 CEST 2017
On 18 April 2017 at 10:29, Gianfranco Alongi <>
> It kind of sounds similar to the idea behind gproc, which is a widely used
> so as everyone has said already - this is perfectly fine.
Doesn't gproc store the process metadata in an ETS table? That's a valid
approach, too, but you need a monitor process to clean up if the process
As another pro-example of storing information in the process dictionary;
this is what lager does with metadata -- see lager:md.
Both approaches are valid: we use all of the following:
1. Process dictionary (usually for lager, but sometimes separately).
2. Separate process registry using one or more ETS tables (we don't use
gproc; we wanted slightly different semantics).
3. Process responds to gen_server:call(Pid, info)
They're useful for different information, for different scenarios.
I'd be reluctant to use the process dictionary for anything other than
process-internal-use or debugging information, though.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions