[erlang-questions] Scoped group leaders

Eric Merritt ericbmerritt@REDACTED
Tue Jul 5 17:05:53 CEST 2011

I understand and that makes sense, but it does raise a potential
problem. That is group leaders are created but never destroyed. In the
case of the process itself, this is probably ok. The developer will
have to create some mechanism to know when his group leader is no
longer useful and have it die on its own. However, I didn't see any
mechanisms to unregister group leaders and reclaim the memory alloced
when they are created. That could be me missing something when I was
looking at the code, if so then the point is moot, however if not
that's something that would probably need to be added to make this
workable. Of course, that still leaves the problem that if a group
leader dies unexpectedly, or the user mis-codes his application and
forgets to unregister a group leader when it dies, then he has a
memory leak. You could say that its a users problem and go from there,
but leaving around unreferenced memory just doesn't smell right. (I
know, we do that already with the atom table, but it doesn't make it a
good thing)

On Mon, Jul 4, 2011 at 6:57 PM, Robert Virding
<robert.virding@REDACTED> wrote:
> ----- "Eric Merritt" <ericbmerritt@REDACTED> wrote:
>> >
>> >
>> >> Just out of curiosity does a group leader go away when a group
>> dies?
>> >
>> > Define group death?
>> >
>> When when all processes in a group have terminated, either normally
>> or
>> abnormally.
> Today there is nothing in the system which keeps track of the processes in a group, process groups don't really exist at all. A "process group" is those processes which have the same group leader. The group leader has no information about which processes have it as group leader. You can make any process a group leader by setting it as group leader.
> Process groups were explicitly added in such a way as NOT to impose any structure or hierarchy on processes, process space is flat.
> Robert

More information about the erlang-questions mailing list