[erlang-questions] What's the most efficient method to broadcast a message to multiple (100Ks) of processes?
Thu Oct 7 14:11:54 CEST 2010
Basically, raise priority to high around your sending loop and then get it back to normal right after.
On Oct 7, 2010, at 8:01 PM, Zvi wrote:
> 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?
More information about the erlang-questions