[erlang-questions] Supervisors as factories *and* registries

Garrett Smith <>
Tue Mar 23 18:18:04 CET 2010

On Mon, Mar 22, 2010 at 10:26 PM, Ulf Wiger
<> wrote:
> Garrett Smith wrote:
>> Bit I need a finer grained interface to supervised children. I wish
>> supervisors exposed state the way gen_server does, in which case I
>> could maintain an index (for example) that would let me access
>> children more efficiently. (This seems like a conspicuously missing
>> feature, but there's probably a good reason for it.)
> I'm not entirely sure what you're after, but it seems a bit similar
> to what I described in the gproc paper from the Erlang Workshop '07:
> http://github.com/uwiger/gproc/raw/master/doc/erlang07-wiger.pdf
> See e.g. chapters 2.2.2 and 6.1

Now I finally know what gproc is!

Yes, this is exactly what I'm talking about. In particular:

3.4: When performing operations on batches of calls/processes, it is
vital that the operations scale to tens or hundreds of thousand
processes. Furthermore, while debugging a live system, the sup-port
engineer or designer needs to be able to browse process list-ings
without risking damage or overload to the system. Due to the
complexity of the software, it is important that dependencies be-tween
processes are as visible and regular as possible.

At the moment, I'm using supervisor:which_children/1. This isn't
terrible as long as the process count stays low and the processes
expose a common interface to their properties. My thinking was to
extend the supervisor as a registry for use in things like dispatch,
process queries, etc.

Obviously gproc is a bit more comprehensive :)

Is there a recommended branch (trunk?) for using gproc with R13B03+ ?
I wouldn't be using the global/distributed functionality, but local
registry would I think handily meet my requirements.


More information about the erlang-questions mailing list