[erlang-questions] excute code in the supervisor when a child crashes?

Ulf Wiger <>
Tue Oct 20 09:49:01 CEST 2009

Mihai Balea wrote:
> I don't have much hands on experience with gproc, but from what I hear, 
> you only need the kernel patches if you want gproc to replace the built 
> in process registry.


I should have been clearer about this from the start.

The reason for patching some of the core OTP libraries was
to demonstrate how gproc could be used if it were made a core
part of the system. The things I demonstrated in my paper were
e.g. listing all supervisors with their restart parameters, and
listing all gen_servers in the system.

It didn't replace the built-in registry, though. It could
possibly replace 'global' in time, but you should mainly
see it as a complement.

> If you use it as a standalone module, you only need 
> gen_leader, which is indeed a dependency.

The 'experimental' part of the experimental branch was that
I split gen_leader into two - one local and one global part.

This was trivial, since the API separates local and global
context. The local part is pretty well tested and, I believe,
also in actual use. I haven't finished the global part. The
intention is to make use of the standard gen_leader, rather
than the crummy patch that was in the initial gproc prototype.

(The only reason for patching in the first place was that the
demo inserted gproc in the OTP kernel application, in a way
that it had to start before Distributed Erlang was up and
running. This led to some unholy hacking of gen_leader.
Splitting gproc in two solves this problem in a much better
way. My only excuse for not thinking about it from the beginning
is that I was in a hurry to finish the paper before the deadline).

The place to get gen_leader nowadays is:

Ulf Wiger
CTO, Erlang Training & Consulting Ltd

More information about the erlang-questions mailing list