process groups - bug or feature?

Serge Aleynikov <>
Mon Mar 28 23:28:08 CEST 2005


Hi All,

I wonder if this is a bug or a feature:

Erlang (BEAM) emulator version 5.4.3 [source] [hipe] [threads:8]

Eshell V5.4.3  (abort with ^G)
()1> nodes().
[]
()2> pg2:create(test).
ok
()3> pg2:get_members(test).
[]
()4> pg2:join(test, self()).
ok
()5> pg2:get_members(test).
[<0.36.0>]
()6> pg2:join(test, self()).
ok
()7> pg2:get_members(test).
[<0.36.0>,<0.36.0>]

While this is not documented, I would intuitively assume that the same 
process should not be allowed to join a process group more than once. 
Could someone explain if this is a bug or a feature?

Also pg module sends motifications to other members of a group when a 
member joins/leaves the group.  pg2 does not.  Is there a reason not to 
notify other group members of membership changes?

Thanks,

Serge





More information about the erlang-questions mailing list