process groups - bug or feature?

Serge Aleynikov serge@REDACTED
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)
(srv@REDACTED)1> nodes().
[]
(srv@REDACTED)2> pg2:create(test).
ok
(srv@REDACTED)3> pg2:get_members(test).
[]
(srv@REDACTED)4> pg2:join(test, self()).
ok
(srv@REDACTED)5> pg2:get_members(test).
[<0.36.0>]
(srv@REDACTED)6> pg2:join(test, self()).
ok
(srv@REDACTED)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