What's the most efficient method to broadcast a message to multiple (100Ks) of processes?

Zvi <>
Thu Oct 7 14:01:47 CEST 2010


Hi,

what's the most efficient method to broadcast a message to multiple
(100Ks) of processes?

The most naive way is:

   [ Pid ! Msg || Pid<-Pids ].

less naive method:

   [ spawn(fun() -> [Pid ! Msg || Pid<-PidsSublist] end) ||
PidsSublist <- partition(Pids, N) ].

 where partition(L,N) splits list L into N sublists.

Any ideas for better method?

thanks,
Zvi


More information about the erlang-questions mailing list